public IActionResult DeleteFaculty(int id) { var facultyFromDb = _facultyRepo.GetFisrtOrDefault(c => c.Id == id); if (facultyFromDb != null) { _facultyRepo.Remove(facultyFromDb); _facultyRepo.Save(); return(Json(new { status = true, message = "Deleted Suucessfully" })); } else { return(Json(new { status = false, message = "Unable to delete" })); } }