Rest Client .NET
Prerequisites
Add the following dependencies to your project:
Authentication
var oneErp = new OneERPServer("localhost:8181");
try {
//Authtentication
oneErp.Authenticate("vlad", "1234", "ro");
} catch (AuthenticationException e) {
}
Entity models
Without children
[DataContract]
public class Product : IEntityProperties {
public long? Key { get; set; }
[DataMember(Name = "name")]
public string Name { get; set; }
}
With children
[DataContract]
public class MenuNode : IEntityProperties {
public long? Key { get; set; }
[DataMember(Name = "name")]
public string Name { get; set; }
}
[DataContract]
public class MenuNodeItem : IEntityProperties {
public long? Key { get; set; }
[DataMember(Name = "name")]
public string Name { get; set; }
}
[DataContract]
public class MenuNodeChildren {
[DataMember(Name = "menu_node_menu_node_item")]
public List<SimpleEntity<MenuNodeItem>> Items { get; set; }
}
Reading an entity
Entity without children
Entity with children
Creating an entity
Entity without children
Entity with children
Updating an entity
Deleting an entity
Run workflow