/// <summary> /// Pulls the data from the remote Azure App Service and stores them into the local database. /// </summary> /// <param name="ct">The cancellation token.</param> /// <param name="uniqueQueryId">The unique ID of the query.</param> /// <param name="predicate">The predicate to use.</param> /// <returns></returns> public async Task Pull(CancellationToken ct, string uniqueQueryId, Expression <Func <T, bool> > predicate) { if (_supportsLocalStore) { await TableLocal.PullAsync(uniqueQueryId, TableLocal.Where(predicate), ct); } }
/// <summary> /// Performs a database Get operation and returns all of the items that correspond to the specified predicate. /// </summary> /// <param name="predicate">The predicate to use.</param> /// <param name="criteria">The criteria for the where clause.</param> /// <returns>The list of T objects matching the predicate or the criteria</returns> public async Task <List <T> > FindAll(Expression <Func <T, bool> > predicate, Dictionary <string, object> criteria = null) { if (_supportsLocalStore) { if (Application.platform == RuntimePlatform.IPhonePlayer) { if (PredicateCanRunAsSql(predicate.Body.ToString()) && criteria != null) { return(FindAllSql(criteria)); } } return(await TableLocal.Where(predicate).ToListAsync()); } else { return(await TableCloud.Where(predicate).ToListAsync()); } }