-
Notifications
You must be signed in to change notification settings - Fork 93
High level API CRUD
Daniel Frantik edited this page Apr 9, 2017
·
4 revisions
All data-modify methods are implemented as extension methods of ITikConnection and ITikCommand objects. Every works with some data entity. For details about entities see this wiki page.
- Save: Saves entity to mikrotik router.
- SaveListDifferences: Advanced version of Save which works with whole list of entities.
- Delete: Deletes entity (.id is the key) on mikrotik router.
- DeleteAll: Deletes all entities of given type on mikrotik router.
- Move: Moves given entityToMove before given entityToMoveBefore.
- MoveToEnd: Moves given entityToMove to the end (make it last entity in the list).
Saves entity to mikrotik router. Does insert (/add) whan entity has empty id and update(/set + /unset) when id is present).
var firewallFilter = new FirewallFilter()
{
Chain = FirewallFilter.ChainType.Forward,
Action = FirewallFilter.ActionType.Accept,
};
connection.Save(firewallFilter);
Advanced version of Save which works with whole list of entities. See advanced scenarions for details.
Deletes entity (.id is the key) on mikrotik router.
var loadedFilter = Connection.LoadById<BridgeFilter>(filter.Id);
connection.Delete<BridgeFilter>(loadedFilter);
Deletes all entities of given type on mikrotik router.
int deletedCnt = Connection.DeleteAll<HotspotUser>();
Moves given entityToMove before given entityToMoveBefore. REMARKS: only some entities supports ordering.
Moves given entityToMove to the end (make it last entity in the list). REMARKS: only some entities supports ordering.