public async Task <ActionResult> CreateAsync(EmployeeViewModel employeeViewModel) { _logger.LogInformation("Creating A New Employee"); //checking model state if (ModelState.IsValid) { try { var emp = await _employeeService.CreateEmployee(_objectMapper.EmployeeViewModelToEmployee(employeeViewModel)); return(RedirectToAction("Index")); } catch (Exception ex) { _logger.LogError("Error Creating a New Employee {0}", ex.Message); return(View(ex.InnerException.Message)); } } return(View()); }