Querying DnsStatic entries when an existing entry has an empty name results in an exception
Steps to reproduce:
In winbox create a static dns entry without a name: /ip dns static add address=1.1.1.1 regexp=*.local
In a c# program open a connection and execute: var dns = connection.LoadAll<DnsStatic>();
Expected result:
Command succeeds.
Observed result:
tik4net.TikSentenceException
HResult=0x80131500
Message=Missing word with name 'name'.
Source=tik4net
StackTrace:
at tik4net.Api.ApiSentence.GetWordValue(String wordName) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net\Api\ApiSentence.cs:line 89
at tik4net.Api.ApiReSentence.GetResponseField(String fieldName) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net\Api\ApiReSentence.cs:line 22
at tik4net.Objects.TikCommandExtensions.GetValueFromSentence(ITikReSentence sentence, TikEntityPropertyAccessor property) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net.objects\TikCommandExtensions.cs:line 167
at tik4net.Objects.TikCommandExtensions.CreateObject[TEntity](ITikReSentence sentence) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net.objects\TikCommandExtensions.cs:line 157
at tik4net.Objects.TikCommandExtensions.<>c__0`1.<LoadList>b__0_0(ITikReSentence sentence) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net.objects\TikCommandExtensions.cs:line 32
at System.Linq.Enumerable.SelectListIterator`2.ToList()
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at tik4net.Objects.TikCommandExtensions.LoadList[TEntity](ITikCommand command) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net.objects\TikCommandExtensions.cs:line 32
at tik4net.Objects.TikConnectionExtensions.LoadList[TEntity](ITikConnection connection, ITikCommandParameter[] filterParameters) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net.objects\TikConnectionExtensions.cs:line 183
at tik4net.Objects.TikConnectionExtensions.LoadAll[TEntity](ITikConnection connection) in E:\Users\andrewsav\Documents\GitHub\tik4net\tik4net.objects\TikConnectionExtensions.cs:line 63
at test.Program.Main(String[] args) in E:\packer\mikrotik\test\Program.cs:line 17
Additional Information
It appears, that the Name field is set mandatory here. Instead, the code should check that at least one of the fields is present: Name and Regexp.
Synopsis:
Querying DnsStatic entries when an existing entry has an empty name results in an exception
Steps to reproduce:
/ip dns static add address=1.1.1.1 regexp=*.local
var dns = connection.LoadAll<DnsStatic>();
Expected result:
Command succeeds.
Observed result:
Additional Information
It appears, that the Name field is set mandatory here. Instead, the code should check that at least one of the fields is present: Name and Regexp.