private async Task <CrossClientCashoutAggregate> TryGetAsync(Guid operationId) { var partitionKey = CrossClientCashoutEntity.GetPartitionKey(operationId); var rowKey = CrossClientCashoutEntity.GetRowKey(operationId); var entity = await _storage.GetDataAsync(partitionKey, rowKey); return(entity?.ToDomain()); }
public async Task <CrossClientCashoutAggregate> GetOrAddAsync(Guid operationId, Func <CrossClientCashoutAggregate> newAggregateFactory) { var partitionKey = CrossClientCashoutEntity.GetPartitionKey(operationId); var rowKey = CrossClientCashoutEntity.GetRowKey(operationId); var startedEntity = await _storage.GetOrInsertAsync( partitionKey, rowKey, () => { var newAggregate = newAggregateFactory(); return(CrossClientCashoutEntity.FromDomain(newAggregate)); }); return(startedEntity.ToDomain()); }
public async Task SaveAsync(CrossClientCashoutAggregate aggregate) { var entity = CrossClientCashoutEntity.FromDomain(aggregate); await _storage.ReplaceAsync(entity); }