public override async Task ExecuteLocalAsync(IMobileServiceLocalStore store, JObject item) { if (await store.LookupAsync(this.TableName, this.ItemId) != null) { throw new MobileServiceLocalStoreException("An insert operation on the item is already in the queue.", null); } await store.UpsertAsync(this.TableName, item, fromServer : false); }
public override async Task ExecuteLocalAsync(IMobileServiceLocalStore store, JObject item) { if (await store.LookupAsync(this.TableName, this.ItemId) != null) { throw new MobileServiceLocalStoreException("An insert operation on the item is already in the queue.", null); } await store.UpsertAsync(this.TableName, item, fromServer: false); }
public override async Task ExecuteLocalAsync(IMobileServiceLocalStore store, JObject item) { if (await store.LookupAsync(this.TableName, this.ItemId) != null) { throw new MobileServiceLocalStoreException(Resources.SyncContext_DuplicateInsert, null); } await store.UpsertAsync(this.TableName, item, fromServer : false); }
/// <summary> /// Updates or inserts data in local table. /// </summary> /// <param name="store">Instance of <see cref="IMobileServiceLocalStore"/></param> /// <param name="tableName">Name of the local table.</param> /// <param name="item">Item to be inserted.</param> /// <param name="fromServer"><code>true</code> if the call is made based on data coming from the server e.g. in a pull operation; <code>false</code> if the call is made by the client, such as insert or update calls on an <see cref="IMobileServiceSyncTable"/>.</param> /// <returns>A task that completes when item has been upserted in local table.</returns> public static Task UpsertAsync(this IMobileServiceLocalStore store, string tableName, JObject item, bool fromServer) { return(store.UpsertAsync(tableName, new[] { item }, fromServer)); }
public override Task ExecuteLocalAsync(IMobileServiceLocalStore store, JObject item) { return(store.UpsertAsync(this.TableName, item, fromServer: false)); }
public override Task ExecuteLocalAsync(IMobileServiceLocalStore store, JObject item) { return store.UpsertAsync(this.TableName, item, fromServer: false); }