示例#1
0
        public async Task <List <AccountBalance> > GetAccountBalances(List <long> accountIds)
        {
            var accountParametersTable = new AccountIdUserTableParam(accountIds);

            accountParametersTable.Add("@allowancePercentage", _configuration.TransferAllowancePercentage, DbType.Decimal);

            var result = await _db.Value.Database.Connection.QueryAsync <AccountBalance>(
                sql : "[employer_financial].[GetAccountBalance_ByAccountIds]",
                param : accountParametersTable,
                transaction : _db.Value.Database.CurrentTransaction.UnderlyingTransaction,
                commandType : CommandType.StoredProcedure);

            return(result.ToList());
        }
示例#2
0
        public async Task <List <AccountBalance> > GetAccountBalances(List <long> accountIds)
        {
            var result = await WithConnection(async c =>
            {
                var parameters = new AccountIdUserTableParam(accountIds);

                return(await c.QueryAsync <AccountBalance>(
                           "[employer_financial].[GetAccountBalance_ByAccountIds]",
                           parameters,
                           commandType: CommandType.StoredProcedure));
            });

            return(result.ToList());
        }