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); }
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>()); } }