public ActionResult <Trainer> GetBySpecialty(string specialty) { try { return(_repo.GetSpecialty(specialty)); } catch (Exception e) { // do some stuff to handle the error return(StatusCode(500)); } }
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)); } }