public async Task <IActionResult> Create([Bind("DepartmentID,DepartmentName,Description")] DepartmentModel departmentModel) { if (ModelState.IsValid) { _tempContext.Add(departmentModel); await _tempContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(departmentModel)); }
public async Task <IActionResult> Create([Bind("EmployeeID,Name,Surname,Address,Qualification,Contact,DepartmentName")] EmployeeModel employeeModel) { if (ModelState.IsValid) { _tempContext.Add(employeeModel); await _tempContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employeeModel)); }