public ParseWhereFragment ( IQueryableDocument mapping, |
||
mapping | IQueryableDocument | |
expression | ||
Результат | IWhereFragment |
private IWhereFragment buildWhereClause() { var wheres = _query.BodyClauses.OfType <WhereClause>().ToArray(); if (wheres.Length == 0) { return(null); } return(wheres.Length == 1 ? _parser.ParseWhereFragment(_mapping, wheres.Single().Predicate) : new CompoundWhereFragment(_parser, _mapping, "and", wheres)); }
private IWhereFragment buildWhereClause() { var wheres = _query.BodyClauses.OfType <WhereClause>().ToArray(); if (wheres.Length == 0) { return(_mapping.DefaultWhereFragment()); } var where = wheres.Length == 1 ? _parser.ParseWhereFragment(_mapping, wheres.Single().Predicate) : new CompoundWhereFragment(_parser, _mapping, "and", wheres); return(_mapping.FilterDocuments(where)); }
internal static IWhereFragment BuildWhereFragment(this IDocumentStorage storage, QueryModel query, MartenExpressionParser parser) { var wheres = query.AllBodyClauses().OfType <WhereClause>().ToArray(); if (wheres.Length == 0) { return(storage.DefaultWhereFragment()); } var @where = wheres.Length == 1 ? parser.ParseWhereFragment(storage.Fields, wheres.Single().Predicate) : new CompoundWhereFragment(parser, storage.Fields, "and", wheres); return(storage.FilterDocuments(query, @where)); }
private string appendWhereClause(string sql, NpgsqlCommand command) { var wheres = _query.BodyClauses.OfType <WhereClause>().ToArray(); if (wheres.Length == 0) { return(sql); } var where = wheres.Length == 1 ? MartenExpressionParser.ParseWhereFragment(typeof(T), wheres.Single().Predicate) : new CompoundWhereFragment(typeof(T), "and", wheres); sql += " where " + where.ToSql(command); return(sql); }
public CompoundWhereFragment(MartenExpressionParser parser, IFieldMapping mapping, string separator, IEnumerable <WhereClause> wheres) { _separator = separator; _children = wheres.Select(x => parser.ParseWhereFragment(mapping, x.Predicate)).ToList(); }
public CompoundWhereFragment(MartenExpressionParser parser, IDocumentMapping mapping, string separator, IEnumerable<WhereClause> wheres) { _separator = separator; _children = wheres.Select(x => parser.ParseWhereFragment(mapping, x.Predicate)).ToArray(); }
public CompoundWhereFragment(Type rootType, string separator, IEnumerable <WhereClause> wheres) { _separator = separator; _children = wheres.Select(x => MartenExpressionParser.ParseWhereFragment(rootType, x.Predicate)).ToArray(); }