Beispiel #1
0
 public IQueriable <T> CondWhere <T>(this IQueriable <T> query, bool condition, Expression <Func <T, bool> > predicate)
 {
     if (condition)
     {
         return(query.Where(predicate));
     }
     else
     {
         return(query);
     }
 }
Beispiel #2
0
 public IQueriable <Product> FreshOnly(this IQueriable <Product> query)
 {
     return(query.Where(x => x.PackTime >= DateTime.Now.AddDays(-1)));
 }
Beispiel #3
0
 public IQueriable <Product> SelectVegetables(this IQueriable <Product> query)
 {
     return(query.Where(x => x.Type == "Vegetable"));
 }