Beispiel #1
0
        public static ExpressionStarter <Vandor> GetPredicate(this QVandor query)
        {
            var predicate = PredicateBuilder.New <Vandor>(true);

            if (query.Status != null)
            {
                predicate = predicate.And(o => o.Status == query.Status);
            }
            if (query.TaxStatus != null)
            {
                predicate = predicate.And(o => o.TaxStatus == query.TaxStatus);
            }
            return(predicate);
        }
Beispiel #2
0
        public async Task <PagedResult <PTCStore.Models.Vandor> > Vandors(PTCStore.QueryModels.QVandor query, int page, int pageSize = 10)
        {
            var rs = _context.Vandors.Where(query.GetPredicate());//.Select(o=>new RPurchase());

            return(await rs.GetPagedAsync(pageSize, page, query.Sort));
        }