Esempio n. 1
0
        public HttpResponseMessage GetAllOrders()
        {
            HttpResponseMessage message = null;

            try
            {
                CustomerOrderRepository customerRepo = new CustomerOrderRepository();
                var OrderList = customerRepo.GetAllOrders();

                message      = Request.CreateResponse(HttpStatusCode.Accepted, OrderList);
                customerRepo = null;
            }
            catch (Exception ex)
            {
                message = Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message.ToString());
            }

            return(message);
        }