コード例 #1
0
        public GetProductsResponse GetProductByCriteria(GetProductsRequest request)
        {
            if (!HttpContext.Current.User.Identity.IsAuthenticated)
                throw new FaultException<NotAuthenticatedFault>(new NotAuthenticatedFault());
            GetProductsResponse response = new GetProductsResponse();
            ProductBusinessComponent bc = DependencyInjectionHelper.GetProductBusinessComponent();

            IQueryable<Product> products = bc.GetProductsByCriteria(request.SearchType, request.Category, request.ProductName);
            response.Products = ProductAdapter.ProductsToDtos(products);

            return response;
        }
コード例 #2
0
ファイル: AdminService.cs プロジェクト: ikelos555/HSROrderApp
        public GetProductsResponse GetProductsByCriteria(GetProductsRequest request)
        {
            GetProductsResponse response = new GetProductsResponse();
            ProductBusinessComponent bc = DependencyInjectionHelper.GetProductBusinessComponent();

            IQueryable<Product> products = bc.GetProductsByCriteria(request.SearchType, request.Category, request.ProductName);
            response.Products = ProductAdapter.ProductsToDtos(products);

            return response;
        }
コード例 #3
0
 private IList<ProductDTO> getProducts(ProductSearchType searchType, string name, string category)
 {
     try
     {
         GetProductsRequest request = new GetProductsRequest();
         request.SearchType = searchType;
         request.ProductName = name;
         request.Category = category;
         GetProductsResponse response = Service.GetProductsByCriteria(request);
         return response.Products;
     }
     catch (Exception ex)
     {
         if (ExceptionPolicy.HandleException(ex, "PL Policy")) throw;
         return new List<ProductDTO>();
     }
 }