public async Task Create( EmployeeModel employeeModel) { _context.Add(employeeModel); await _context.SaveChangesAsync(); }
public async Task <IActionResult> Create([Bind("Name,Email,Password,ConfirmPassword,Address,Phone")] RegisterModel registerModel) { if (ModelState.IsValid) { _context.Add(registerModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(HomeController.Index), "Home")); } return(RedirectToAction(nameof(HomeController.Index), "Home")); }
public async Task <IActionResult> Create([Bind("Name,RollNo,Class,Sec,EnglishM,MathsM,ScienceM,ID")] LqStudentModel lqStudentModel) { if (ModelState.IsValid) { _context.Add(lqStudentModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(lqStudentModel)); }
public async Task <IActionResult> Create([Bind("ID,ProductName,ImgUrl,Price,Description")] LaptopModel laptopModel) { if (ModelState.IsValid) { _context.Add(laptopModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(laptopModel)); }