public IActionResult GetAllThreeObjectsByPersonId(string personId)
 {
     try
     {
         ThreeObjectsModel threeObjectsModel = threeObjectsRepository.GetAllThreeObjectsByPersonId(personId);
         return(Ok(threeObjectsModel));
     }
     catch (Exception ex)
     {
         Errors errors = ErrorsHelper.GetErrors(ex);
         return(StatusCode(StatusCodes.Status500InternalServerError, errors));
     }
 }
Example #2
0
 public HttpResponseMessage GetAllThreeObjectsByPersonId(string personId)
 {
     try
     {
         ThreeObjectsModel threeObjectsModel = threeObjectsRepository.GetAllThreeObjectsByPersonId(personId);
         return(Request.CreateResponse(HttpStatusCode.OK, threeObjectsModel));
     }
     catch (Exception ex)
     {
         Errors errors = ErrorsHelper.GetErrors(ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, errors));
     }
 }
 public HttpResponseMessage GetAllThreeObjectsByPersonId(string personId)
 {
     try
     {
         HttpResponseMessage hrm = new HttpResponseMessage(HttpStatusCode.OK)
         {
             Content = new StringContent(JsonConvert.SerializeObject(threeObjectsRepository.GetAllThreeObjectsByPersonId(personId)))
         };
         return(hrm);
     }
     catch (Exception ex)
     {
         Errors errors          = ErrorsHelper.GetErrors(ex);
         HttpResponseMessage hr = new HttpResponseMessage(HttpStatusCode.InternalServerError)
         {
             Content = new StringContent(errors.ToString())
         };
         return(hr);
     }
 }