public async Task Save(QueryModel queryModel) { queryModel.partitionKey = PartitionKeyGenerator.Generate(queryModel.id, _noOfPartitions); await DocumentDbRetryPolicy.ExecuteWithRetries( () => _client.UpsertDocumentAsync(GetCollectionUri(), queryModel, null, disableAutomaticIdGeneration: true) ); }
public async Task DeleteById <T>(Guid aggregateId) where T : QueryModel { var options = CreateRequestOptions(aggregateId); await DocumentDbRetryPolicy.ExecuteWithRetries( async() => _client.DeleteDocumentAsync(await GetDocumentUri <T>(aggregateId), options) ); }
public async Task <T> QueryItem <T>(Expression <Func <T, bool> > predicate) where T : QueryModel { return(await DocumentDbRetryPolicy.ExecuteWithRetries( () => QueryItemInternal <T>(predicate) )); }
public async Task Save(QueryModel queryModel) { await DocumentDbRetryPolicy.ExecuteWithRetries( () => _client.UpsertDocumentAsync(GetCollectionUri(), queryModel, null, disableAutomaticIdGeneration: true) ); }
//TODO: Should this method be deleted? public async Task <bool> DoesItemExist <T>(Guid id) where T : QueryModel { return(await DocumentDbRetryPolicy.ExecuteWithRetries( () => DoesItemExistInternal <T>(id) )); }
public async Task <T> GetById <T>(Guid id) where T : QueryModel { return(await DocumentDbRetryPolicy.ExecuteWithRetries( () => GetByIdInternal <T>(id) )); }
public async Task <List <dynamic> > ExecuteRawSql(string sql) { return(await DocumentDbRetryPolicy.ExecuteWithRetries( () => ExecuteRawSqlInternal(sql) )); }
public async Task <int> QueryCountAsync <T>() where T : QueryModel { return(await DocumentDbRetryPolicy.ExecuteWithRetries( () => QueryCountAsyncInternal <T>() )); }
public async Task <PagedResult <T> > GetPagedListAsync <T>(PagedQuery pagedQuery, Expression <Func <T, bool> > predicate) where T : QueryModel { return(await DocumentDbRetryPolicy.ExecuteWithRetries( () => GetPagedListAsyncInternal <T>(pagedQuery, predicate) )); }
public async Task <List <T> > GetByIds <T>(List <Guid> ids) where T : QueryModel { return(await DocumentDbRetryPolicy.ExecuteWithRetries( () => GetByIdsInternal <T>(ids) )); }