Esempio n. 1
0
 public ActionResult Create(EmployeeViewModel evm)
 {
     try
     {
         Employee emp = evm.Employee;
         emp.Firm = firmRepo.GetById(evm.SelectedFirmId);
         employeeRepo.Create(emp);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(evm));
     }
 }
 public IActionResult Create([FromBody] Model.Employee newEmployee)
 {
     return(StatusCode(StatusCodes.Status200OK, repo.Create(newEmployee)));
 }
 public async virtual Task Create(Employee employee)
 {
     // Save to Repo first
     await _employeeRepo.Create(employee);
 }