Exemplo n.º 1
0
        public async Task <LykkeAccount> GetAsync(string id)
        {
            var partitionKey = MockLykkeAccountEntity.GeneratePartitionKey();
            var rowKey       = MockLykkeAccountEntity.GenerateRowKey(id);

            return((await _tableStorage.GetDataAsync(partitionKey, rowKey)).Instance);
        }
Exemplo n.º 2
0
        public async Task <LykkeAccount> DepositWithdrawAsync(string id, double amount)
        {
            var partitionKey = MockLykkeAccountEntity.GeneratePartitionKey();
            var rowKey       = MockLykkeAccountEntity.GenerateRowKey(id);
            var result       = await _tableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                var instance      = itm.Instance;
                instance.Balance += amount;
                itm.Instance      = instance;
                return(itm);
            });

            return(result.Instance);
        }
Exemplo n.º 3
0
        public Task SaveAsync(LykkeAccount account)
        {
            var newEntity = MockLykkeAccountEntity.Create(account);

            return(_tableStorage.InsertAsync(newEntity));
        }