namespace marlin.web.Util; using System.Linq.Expressions; public static class IQueryableExtensions { public static IQueryable WhereIf( this IQueryable self, bool cond, Expression> predicate) { return cond ? self.Where(predicate) : self; } }