コード例 #1
0
 public ActionResult <Trainer> GetBySpecialty(string specialty)
 {
     try
     {
         return(_repo.GetSpecialty(specialty));
     }
     catch (Exception e)
     {
         // do some stuff to handle the error
         return(StatusCode(500));
     }
 }
コード例 #2
0
 public ActionResult <Trainer> GetBySpecialty(string specialty)
 {
     try
     {
         var repo = new TrainerRepository();
         return(repo.GetSpecialty(specialty));
     }
     catch (Exception e)
     {
         // do some stuff to handle the error
         return(StatusCode(500, e));
     }
 }