public async Task <IActionResult> Remove(RemoveEmployee request) { await _mediator.Process(request); Alert("Employee was successfully removed"); return(RedirectToAction("Index")); }
// GET: HREmployees/Delete/5 public ActionResult Delete(int?id) { if (id != null) { IRemoveItem removeEmployee = new RemoveEmployee(); string userId = removeEmployee.Save(id, _db); if (userId.Length > 0) { ApplicationUser user = UserManager.FindById(userId); UserManager.Delete(user); } } return(RedirectToAction("Index")); }