// GET: Student
 public async Task <IActionResult> ShowAll()
 {
     try
     {
         return(View(await studentRepository.AllIncludeProgrammeAsync()));
     }
     catch (DataAccessException e)
     {
         ViewBag.ErrorMsg = ErrorProcessing.ProcessException("Data Access exception. ", e);
         return(RedirectToAction("Unknown", "Error"));
     }
     catch (Exception e)
     {
         ViewBag.ErrorMsg = ErrorProcessing.ProcessException("General exception. ", e);
         return(RedirectToAction("Unknown", "Error"));
     }
 }
Example #2
0
 public async Task <IEnumerable <Student> > Get()
 {
     return(await studentRepository.AllIncludeProgrammeAsync());
 }