Ejemplo n.º 1
0
        public async Task <EthereumCashinAggregate> GetAsync(string trHash)
        {
            var partitionKey = EthereumCashinAggregateEntity.GetPartitionKey(trHash);
            var rowKey       = EthereumCashinAggregateEntity.GetRowKey(trHash);

            var entity = await _storage.GetDataAsync(
                partitionKey,
                rowKey);

            return(entity.ToDomain());
        }
Ejemplo n.º 2
0
        public async Task <EthereumCashinAggregate> GetOrAddAsync(string trHash, Func <EthereumCashinAggregate> newAggregateFactory)
        {
            var partitionKey = EthereumCashinAggregateEntity.GetPartitionKey(trHash);
            var rowKey       = EthereumCashinAggregateEntity.GetRowKey(trHash);

            var startedEntity = await _storage.GetOrInsertAsync(
                partitionKey,
                rowKey,
                () =>
            {
                var newAggregate = newAggregateFactory();

                return(EthereumCashinAggregateEntity.FromDomain(newAggregate));
            });

            return(startedEntity.ToDomain());
        }
Ejemplo n.º 3
0
        public async Task SaveAsync(EthereumCashinAggregate aggregate)
        {
            var entity = EthereumCashinAggregateEntity.FromDomain(aggregate);

            await _storage.ReplaceAsync(entity);
        }