示例#1
0
        public async Task <IActionResult> Create(Account account)
        {
            if (ModelState.IsValid)
            {
                account.EncryptPassword(account.Password);
                _context.Add(account);
                _context.Add(account.Customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(account));
        }
 public T Add(T client)
 {
     return(_context.Add(client).Entity);
 }