public IActionResult Create(AdminCreateVM createVM) { if (!ModelState.IsValid) { return(View(createVM)); } _command.Create(createVM); return(RedirectToAction("List")); }
public void Create(AdminCreateVM createVM) { _admin.FirstName = createVM.FirstName; _admin.LastName = createVM.LastName; _admin.Username = createVM.Username; _admin.Password = createVM.Password; _admin.Email = createVM.Email; _context.Add(_admin); _context.SaveChanges(); }
public IActionResult Create() { var admin = new AdminCreateVM(); return(View(admin)); }