public IActionResult Delete(int id) { var Employee = _Employee.GetById(id); _Employee.Delete(Employee); var allemployeefiles = _File.Find(x => x.EmployeeID == id); foreach (var item in allemployeefiles) { _File.Delete(item); } return(RedirectToAction(nameof(Index))); }