示例#1
0
 public IActionResult Create(AdminCreateVM createVM)
 {
     if (!ModelState.IsValid)
     {
         return(View(createVM));
     }
     _command.Create(createVM);
     return(RedirectToAction("List"));
 }
示例#2
0
        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();
        }
示例#3
0
        public IActionResult Create()
        {
            var admin = new AdminCreateVM();

            return(View(admin));
        }