Esempio n. 1
0
        public GetProductsBySupplierResponse GetProductsBySupplier(GetProductsBySupplier request)
        {
            var response = new GetProductsBySupplierResponse();
            ProductBusinessComponent bc = DependencyInjectionHelper.GetProductBusinessComponent();

            IQueryable <Product> products = bc.GetProductsBySupplierId(request.SupplierId);

            response.Products = ProductAdapter.ProductsToDtos(products);

            return(response);
        }
Esempio n. 2
0
 public IList <ProductDTO> GetProductsBySupplierId(int supplierId)
 {
     try
     {
         var request = new GetProductsBySupplier();
         request.SupplierId = supplierId;
         var response = this.Service.GetProductsBySupplier(request);
         return(response.Products);
     }
     catch (Exception ex)
     {
         if (ExceptionPolicy.HandleException(ex, "PL Policy"))
         {
             throw;
         }
         return(new List <ProductDTO>());
     }
 }