public IActionResult GetAllThreeObjects() { try { List <ThreeObjectsModel> allThreeObjects = threeObjectsRepository.GetAllThreeObjects(); return(Ok(allThreeObjects)); } catch (Exception ex) { Errors errors = ErrorsHelper.GetErrors(ex); return(StatusCode(StatusCodes.Status500InternalServerError, errors)); } }
public HttpResponseMessage GetAllThreeObjects() { try { List <ThreeObjectsModel> allThreeObjects = threeObjectsRepository.GetAllThreeObjects(); return(Request.CreateResponse(HttpStatusCode.OK, allThreeObjects)); } catch (Exception ex) { Errors errors = ErrorsHelper.GetErrors(ex); return(Request.CreateResponse(HttpStatusCode.InternalServerError, errors)); } }
public HttpResponseMessage GetAllThreeObjects() { try { HttpResponseMessage hrm = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(JsonConvert.SerializeObject(threeObjectsRepository.GetAllThreeObjects())) }; return(hrm); } catch (Exception ex) { Errors errors = ErrorsHelper.GetErrors(ex); HttpResponseMessage hr = new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(errors.ToString()) }; return(hr); } }