public async Task <IActionResult> Delete(int?id) { if (id == null) { return(RedirectToAction(nameof(Error), new { message = "Id not provided" })); } var obj = await _ProfessorService.FindByIdAsync(id.Value); if (obj == null) { return(RedirectToAction(nameof(Error), new { message = "Id not found" })); } return(View(obj)); }
// Details public async Task <IActionResult> Details(int?id) { if (id == null) { return(NotFound()); } var obj = await _contextProfessor.FindByIdAsync(id.Value); if (obj == null) { return(NotFound()); } return(View(obj)); }