Пример #1
0
        public HttpResponseMessage Get()
        {
            try
            {
                CarBusiness carbusiness = new CarBusiness();

                List <Car> listCars = carbusiness.GetCars();
                return(Request.CreateResponse(HttpStatusCode.OK, JsonConvert.SerializeObject(listCars)));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest, ex.ToString()));
            }
        }