Exemple #1
0
 public GetDoctorResponse getById(int id)
 {
     try
     {
         var response = new GetDoctorResponse();
         var bc       = new DoctorComponent();
         response.Result = bc.Find(id);
         return(response);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
Exemple #2
0
        public ActionResult GetDataById(int id)
        {
            var doctor = db.Find(id);

            return(Json(doctor, JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
 public Doctor Find(int id)
 {
     return(bs.Find(id));
 }