-
Notifications
You must be signed in to change notification settings - Fork 10
Asynchronous Actions
Dan Lively edited this page Jul 14, 2017
·
2 revisions
SugarSharp also provides the ability to modify data asynchronously.
SugarClient Sugar = new SugarClient(url, username, passsword);
object bean = new
{
name = "Async Testing",
phone_office = "333-443-3552",
description = "Testing out async method calls from C#"
};
Sugar.CreateAsync("Accounts", bean, (success, responseId) =>
{
if (success)
{
Console.WriteLine("1st result {0}", responseId);
}
});
SugarClient Sugar = new SugarClient(url, username, passsword);
String recordID = "<<record_id>>";
object bean = new
{
name = "Async Update Test Account",
phone_office = "333-443-3552",
description = "Update the record description"
};
Sugar.UpdateAsync("Accounts",recordID, bean, (success, responseId) =>
{
if (success)
{
Console.WriteLine("1st result {0}", responseId);
}
});
SugarClient Sugar = new SugarClient(url, username, passsword);
String recordID = "<<record_id>>";
Sugar.DeleteAsync("Accounts", recordID, (success, responseId) =>
{
if (success)
{
Console.WriteLine("Record Deleted : {0}", responseId);
}
});