public Queryable <ModelType> OrNot <PropertyType>(Expression <Func <ModelType, PropertyType> > selector, QueryOperationEnum operation, PropertyType value) { AppendCondition(GetFieldName(selector), operation, value); AppendLogicOperation("OrNot"); return(this); }
private static void AppendCondition <PropertyType>(SearchQuery searchModel, string fieldName, QueryOperationEnum operation, PropertyType value) { searchModel.Query.Add(new ConditionEntity { Index = searchModel.Query.Count, FieldName = fieldName, Operation = operation, Value = value.ToString() }); }
public static Queryable <ModelType> For <PropertyType>(Expression <Func <ModelType, PropertyType> > selector, QueryOperationEnum operation, PropertyType value) { var search = new SearchQuery() { Expression = "Q0" }; AppendCondition(search, GetFieldName(selector), operation, value.ToString()); return(new Queryable <ModelType>(search)); }