public IActionResult Delete(int id) { var employee = _employeeService.GetById(id); if (employee == null) { return(NotFound()); } var model = new EmployeeDeteleViewModel() { Id = employee.Id, FullName = employee.FullName }; return(View(model)); }
public async Task <IActionResult> Delete(EmployeeDeteleViewModel model) { await _employeeService.Delete(model.Id); return(RedirectToAction(nameof(Index))); }