public ActionResult <Employee> AddEmployeeData(Employee emp) { var emp_data = _services.AddEmployeeData(emp); if (emp_data == null) { return(NotFound()); } return(emp_data); }
public ActionResult Create(Employee emp) { try { if (!ModelState.IsValid) { return(View()); } var emp_data = _services.AddEmployeeData(emp); if (emp_data == null) { return(NotFound()); } return(RedirectToAction("Index")); } catch { return(View()); } }