Exemplo n.º 1
0
        public static IRepositoryQuery <TModel> FieldEqualsIf <TModel, TValue>(this IRepositoryQuery <TModel> query, Expression <Func <TModel, object> > objectPath, TValue value = default, Func <TValue, bool> condition = null) where TModel : class
        {
            bool result = condition == null || condition(value);

            return(result ? query.FieldEquals(objectPath, value) : query);
        }
Exemplo n.º 2
0
 public static IRepositoryQuery <TModel> FieldEqualsIf <TModel, TValue>(this IRepositoryQuery <TModel> query, Expression <Func <TModel, object> > objectPath, TValue value = default, bool condition = true) where TModel : class
 {
     return(condition ? query.FieldEquals(objectPath, value) : query);
 }