public async Task <bool> DeleteCustomer(int _customerId) { Customer cust = GetCustomerbyID(_customerId); context.Customer.Remove(cust); await context.SaveChangesAsync(); return(true); }
public async Task <ActionResult> Registar(RegistrationViewModel model) { if (ModelState.IsValid) { Userdetails user = new Userdetails { Name = model.Name, Email = model.Email, Password = model.Password, Mobile = model.Mobile }; _context.Add(user); await _context.SaveChangesAsync(); } else { return(View("Registration")); } return(RedirectToAction("Index", "Account")); }