Пример #1
0
        public HttpResponseMessage GetConsumerComModel(int id)
        {
            ConsumerComModel Consumer = ConsumerComModel.MaptoModel(BusinessFacade.Consumer.Get(id));

            if (Consumer == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }

            return(Request.CreateResponse(HttpStatusCode.OK, Consumer));
        }
Пример #2
0
        // GET: api/Consumer
        public HttpResponseMessage GetConsumerComModels()
        {
            var data = BusinessFacade.Consumer.GetAll().Select(o => ConsumerComModel.MaptoModel(o));

            if (data != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, data));
            }
            else
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound));
            }
        }