/// <summary> /// Inserts a new item /// </summary> public void Insert <T>(T item, Action <AzureResponse <T> > callback = null) where T : class { Log("Inserting:" + item); var ms = CreateHelper <T>(); MobileServiceRequestHelper <T> .SetItemId(item, null); ms.PostAsync(item, callback); Log("Insert request sent."); }
/// <summary> /// Updates a specific item /// </summary> public void Update <T>(T item, Action <AzureResponse <T> > callback = null) where T : class { Log("Updating:" + item); var ms = CreateHelper <T>(); var id = MobileServiceRequestHelper <T> .GetItemId <T>(item); MobileServiceRequestHelper <T> .SetItemId <T>(item, null); ms.PutAsync(item, id, callback); Log("Update request sent."); MobileServiceRequestHelper <T> .SetItemId <T>(item, id); }