public async Task CreateCurrency(string name, CommissionDto dto) { var currency = new CurrencyRecord { Name = name }; await _context.Currencies.AddAsync(currency); await _context.SaveChangesAsync(); var deposit = CommissionManager.CreateCommission(currency.Id, dto, OperationType.Deposit); var transfer = CommissionManager.CreateCommission(currency.Id, dto, OperationType.Transfer); var withdrawal = CommissionManager.CreateCommission(currency.Id, dto, OperationType.Withdrawal); await _context.Commissions.AddRangeAsync(deposit, transfer, withdrawal); await _context.SaveChangesAsync(); }
public CurrencyManager(WalletContext context, CommissionManager commissionManager) { _context = context; _commissionManager = commissionManager; }