コード例 #1
0
 public IHttpActionResult GetSpecialist()
 {
     try
     {
         SpecialistManager manager = new SpecialistManager();
         List <Specialist> lista   = manager.Obtener();
         GetSpecialists    temp;
         temp.specialists = lista;
         return(Ok(temp));
     }catch (Exception e) {
         return(NotFound());
     }
 }
コード例 #2
0
 public IHttpActionResult GetSpecialist(int id)
 {
     try
     {
         SpecialistManager manager = new SpecialistManager();
         var specialist            = manager.Obtener(id);
         if (specialist != null)
         {
             return(Ok(specialist));
         }
         else
         {
             return(NotFound());
         }
     }catch (Exception e) {
         return(NotFound());
     }
 }