示例#1
0
 public GetServiceTypeResponse GetById(int id)
 {
     try
     {
         var response = new GetServiceTypeResponse();
         var bc       = new ServiceTypeComponent();
         response.Result = bc.Find(id);
         return(response);
     }
     catch (Exception ex)
     {
         var httpError = new HttpResponseMessage()
         {
             StatusCode   = (HttpStatusCode)422,
             ReasonPhrase = ex.Message
         };
         throw new HttpResponseException(httpError);
     }
 }
示例#2
0
        public ActionResult GetDataById(int id)
        {
            var serviceType = db.Find(id);

            return(Json(serviceType, JsonRequestBehavior.AllowGet));
        }