Пример #1
0
 public HttpResponseMessage GetAllProductsByCategory(Guid? categoryId)
 {
     try
     {
         var productsService = new ProductsService();
         var products = productsService.GetAllProductsByCategory(categoryId);
         var response = Request.CreateResponse(HttpStatusCode.OK, products);
         return response;
     }
     catch(Exception e)
     {
         var error = Request.CreateResponse(HttpStatusCode.InternalServerError, e.Message);
         return error;
     }
 }