public async Task <IAccount> UpdateAccountTemporaryCapitalAsync(string accountId, Func <string, List <TemporaryCapital>, TemporaryCapital, bool, List <TemporaryCapital> > handler, TemporaryCapital temporaryCapital, bool isAdd) { return(await GetAccountAndUpdate(accountId, a => { a.TemporaryCapital = handler( accountId, ((IAccount)a).TemporaryCapital, temporaryCapital, isAdd ).ToJson(); })); }
public async Task <IAccount> UpdateAccountTemporaryCapitalAsync(string accountId, Func <string, List <TemporaryCapital>, TemporaryCapital, bool, List <TemporaryCapital> > handler, TemporaryCapital temporaryCapital, bool isAdd) { var pk = (await _tableStorage.GetDataRowKeyOnlyAsync(accountId)).Single().PartitionKey; var account = await _tableStorage.MergeAsync(pk, AccountEntity.GenerateRowKey(accountId), a => { a.TemporaryCapital = handler( accountId, ((IAccount)a).TemporaryCapital, temporaryCapital, isAdd ); return(a); }); return(account); }