示例#1
0
        public async Task Update(Account account, Credit credit)
        {
            Entities.Credit creditEntity = new Entities.Credit
            {
                AccountId       = credit.AccountId,
                Amount          = credit.Amount,
                Id              = credit.Id,
                TransactionDate = credit.TransactionDate
            };

            await _context.Credits.AddAsync(creditEntity);

            await _context.SaveChangesAsync();
        }
示例#2
0
        public async Task Add(Account account, Credit credit)
        {
            Entities.Account accountEntity = new Entities.Account()
            {
                CustomerId = account.CustomerId,
                Id         = account.Id
            };

            Entities.Credit creditEntity = new Entities.Credit()
            {
                AccountId       = credit.AccountId,
                Amount          = credit.Amount,
                Id              = credit.Id,
                TransactionDate = credit.TransactionDate
            };

            await _context.Accounts.AddAsync(accountEntity);

            await _context.Credits.AddAsync(creditEntity);

            await _context.SaveChangesAsync();
        }