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); }
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); }