Guest User

Untitled

a guest
Jun 15th, 2015
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1.         public static IEnumerable<Product> GetProformaFormularies(int? productDepartmentId = null, int? productCategoryId = null, IEnumerable<int?> productCategoryIds = null, IEnumerable<string> sections = null) {
  2.             var retList = (from obj in products
  3.                             where (productDepartmentId == null || obj.ProductDepartmentId == productDepartmentId) &&
  4.                                     (productCategoryId == null || obj.ProductCategoryId == productCategoryId) &&
  5.                                     (productCategoryIds == null || productCategoryIds.Contains(obj.ProductCategoryId)) &&
  6.                                     (sections == null || sections.Contains(obj.sections))
  7.                             select obj).ToList();
  8.             return retList;
  9.         }
  10.  
  11.         private static List<Product> products;
  12.  
  13.         public class Product {
  14.             public int ProductDepartmentId, ProductCategoryId;
  15.             public string sections;
  16.         }
Advertisement
Add Comment
Please, Sign In to add comment