danikf / tik4net

Manage mikrotik routers with .NET C# code via ADO.NET like API or enjoy O/R mapper like highlevel api.
Apache License 2.0
174 stars 93 forks source link

connection.LoadAsync<TEntity> throws #38

Closed AsafMag closed 6 years ago

AsafMag commented 6 years ago

The following code:

...
connection.LoadAsync<WirelessAccessList>(
    (item) => { },
    (ex) => { }
);
...

Throws:

interface/wireless/access-list
MESSAGE: no such command

Am I using it wrong?

danikf commented 6 years ago

Hi, I don't understand the reason why load list (sample command returns list just once) with async method. It didn't work (LoadAsync didn't add /print suffix). This behavior has been fixed by 843b50ab7323d8a7227326b4ebf6ecf835d52a94 commit.

So - with DEV tik4net version your sample code will work correctly (but synchronous load is still recomended).

D

AsafMag commented 6 years ago

It would actually be great if you added a tag for the synchronous commands as well, this would make it a lot easier for me. This is the reason I was trying to use LoadAsync. Also please launch an event when an async command gets an ApiDoneSentence @danikf