Esempio 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);
        }
Esempio 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);
        }