Beispiel #1
0
        public IQueryable <Data.Product> GetProductList(ProductListArgs args)
        {
            ExceptionHelper.ThrowIfNull(args, "args");
            var query = _Repository.EnabledProduct;

            if (args != null)
            {
                if (!String.IsNullOrWhiteSpace(args.ClassNo))
                {
                    query = query.Where(d => d.classNo.StartsWith(args.ClassNo));
                }
                if (args.Pids != null && args.Pids.Any())
                {
                    query = query.Where(d => args.Pids.Contains(d.pid));
                }
                if (args.MinPid > 0)
                {
                    query = query.Where(d => d.pid > args.MinPid);
                }
            }
            return(query);
        }
Beispiel #2
0
 public IQueryable<Data.Product> GetProductList(ProductListArgs args)
 {
     ExceptionHelper.ThrowIfNull(args, "args");
     var query = _Repository.EnabledProduct;
     if (args != null)
     {
         if (!String.IsNullOrWhiteSpace(args.ClassNo))
         {
             query = query.Where(d => d.classNo.StartsWith(args.ClassNo));
         }
         if (args.Pids != null && args.Pids.Any())
         {
             query = query.Where(d => args.Pids.Contains(d.pid));
         }
         if (args.MinPid > 0)
         {
             query = query.Where(d => d.pid > args.MinPid);
         }
     }
     return query;
 }