public async Task Add(Customer customer)
        {
            Entities.Customer customerEntity = new Entities.Customer()
            {
                Id   = customer.Id,
                Name = customer.Name,
                SSN  = customer.SSN
            };

            await _context.Customers.AddAsync(customerEntity);

            await _context.SaveChangesAsync();
        }
Example #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();
        }