Exemplo n.º 1
0
        public async Task <Core.Domain.Transfer.Transfer> AddAsync(ITransfer transfer)
        {
            TransferEntity entity = TransferEntity.ByDate.Create(transfer);

            await _storage.InsertAsync(entity);

            AzureIndex indexById = TransferEntity.IndexById.Create(entity);

            await _transferIdIndexStorage.InsertAsync(indexById);

            return(Mapper.Map <Core.Domain.Transfer.Transfer>(entity));
        }
Exemplo n.º 2
0
        public async Task <Core.Domain.Transfer.Transfer> GetAsync(string id)
        {
            AzureIndex index = await _transferIdIndexStorage.GetDataAsync(
                TransferEntity.IndexById.GeneratePartitionKey(id),
                TransferEntity.IndexById.GenerateRowKey());

            if (index == null)
            {
                return(null);
            }

            TransferEntity entity = await _storage.GetDataAsync(index);

            return(Mapper.Map <Core.Domain.Transfer.Transfer>(entity));
        }