public static string BuildFieldDefinition(this QueryNode node, ConvertProperty convertProperty) { convertProperty = convertProperty ?? Default; var propertyParts = node.Accept(PropertyNameVisitor.Instance).ToArray(); var propertyName = convertProperty(propertyParts); return(propertyName); }
/// <summary> /// Main dispatching visit method for translating query-nodes into expressions. /// </summary> /// <param name="node">The node to visit/translate.</param> /// <param name="joinClause">true if join must be extracted</param> /// <returns>The LINQ string resulting from visiting the node.</returns> internal string TranslateNode(QueryNode node, bool joinClause = false) { if (joinClause)//starting { this.joinClause = joinClause; } return(node.Accept(this)); }
public static StringFieldDefinition <T, object> BuildFieldDefinition <T>(this QueryNode node, PropertyCalculator propertyCalculator) { propertyCalculator = propertyCalculator ?? DefaultCalculator; var propertyParts = node.Accept(PropertyNameVisitor.Instance).ToArray(); var propertyName = propertyCalculator(propertyParts); return(new StringFieldDefinition <T, object>(propertyName)); }
public virtual void Visit(QueryNode node) { node.From.Accept(this); node.Where?.Accept(this); node.Select.Accept(this); node.Take?.Accept(this); node.Skip?.Accept(this); node.GroupBy?.Accept(this); node.OrderBy?.Accept(this); node.Accept(Visitor); }
private string Combine(QueryNode source, string name = null) { var sourceString = source.Accept(this).FirstOrDefault(); if (!string.IsNullOrEmpty(sourceString) && BaseString.Length > 0 && sourceString.StartsWith(BaseString)) { sourceString = sourceString.Substring(BaseString.Length + 1); } var stringList = (new[] { BaseString, sourceString, name }).Where(s => !string.IsNullOrEmpty(s)); return(string.Join(_seperator, stringList)); }
public void Visit(QueryNode node) { LoadScope("Query"); node.From.Accept(this); node.Where?.Accept(this); node.Select.Accept(this); node.Take?.Accept(this); node.Skip?.Accept(this); node.GroupBy?.Accept(this); node.OrderBy?.Accept(this); node.Accept(_visitor); RestoreScope(); }
public static StringFieldDefinition <MongoContentEntity, object> Visit(QueryNode node, Schema schema) { var propertyNames = node.Accept(Instance).ToArray(); if (propertyNames.Length == 3) { if (!schema.FieldsByName.TryGetValue(propertyNames[1], out Field field)) { throw new NotSupportedException(); } propertyNames[1] = field.Id.ToString(); } var propertyName = $"do.{string.Join(".", propertyNames.Skip(1))}"; return(new StringFieldDefinition <MongoContentEntity, object>(propertyName)); }
public void Visit(QueryNode node) { _walker = _walker.NextChild(); _visitor.SetScope(_walker.Scope); node.From.Accept(this); node.Where?.Accept(this); node.Select.Accept(this); node.Take?.Accept(this); node.Skip?.Accept(this); node.GroupBy?.Accept(this); node.OrderBy?.Accept(this); node.Accept(_visitor); _walker = _walker.Parent(); _visitor.SetScope(_walker.Scope); }
public void Visit(QueryNode node) { _walker = _walker.NextChild(); _visitor.SetScope(_walker.Scope); _visitor.SetMethodAccessType(MethodAccessType.ResultQuery); _visitor.SetQueryIdentifier(node.From.Alias); node.From.Accept(this); node.Where?.Accept(this); node.Select.Accept(this); node.Take?.Accept(this); node.Skip?.Accept(this); node.GroupBy?.Accept(this); node.OrderBy?.Accept(this); node.Accept(_visitor); _walker = _walker.Parent(); }
public void Visit(QueryNode node) { Query queryState = new Query(); queryState.QueryNode = node; _visitor.SetQuery(queryState); node.From?.Accept(this); node.Where?.Accept(this); node.GroupBy?.Accept(this); node.Skip?.Accept(this); node.Take?.Accept(this); node.OrderBy?.Accept(this); node.Select.Accept(this); node.Accept(_visitor); SetQueryPart(QueryPart.None); }
public static StringFieldDefinition <MongoContentEntity, object> Visit(QueryNode node, Schema schema) { var propertyNames = node.Accept(Instance).ToArray(); if (propertyNames.Length == 3) { if (!schema.FieldsByName.TryGetValue(propertyNames[1], out Field field)) { throw new NotSupportedException(); } propertyNames[1] = field.Id.ToString(); } if (char.IsLower(propertyNames[0][0])) { propertyNames[0] = char.ToUpperInvariant(propertyNames[0][0]) + propertyNames[0].Substring(1); } var propertyName = string.Join(".", propertyNames); return(new StringFieldDefinition <MongoContentEntity, object>(propertyName)); }
public static PropertyPath Visit(QueryNode node) { return(new PropertyPath(node.Accept(Instance))); }
public static ImmutableList <string> Visit(QueryNode node) { return(node.Accept(Instance)); }
public static object Visit(QueryNode node) { return(node.Accept(Instance)); }
public static FilterDefinition <MongoContentEntity> Visit(QueryNode node, Schema schema) { var visitor = new FilterVisitor(schema); return(node.Accept(visitor)); }
/// <summary> /// Main dispatching visit method for translating query-nodes into expressions. /// </summary> /// <param name="node">The node to visit/translate.</param> /// <returns>The LINQ string resulting from visiting the node.</returns> internal string TranslateNode(QueryNode node) { return(node.Accept(this)); }
/// <summary> /// Main dispatching visit method for translating query-nodes into expressions. /// </summary> /// <param name="node">The node to visit/translate.</param> /// <param name="joinClause">true if join must be extracted</param> /// <returns>The LINQ string resulting from visiting the node.</returns> internal string TranslateNode(QueryNode node, bool joinClause = false) { this.joinClause |= joinClause; return(node.Accept(this)); }
internal Expression <Func <string, bool> > TranslateNode(QueryNode node) { Debug.Assert(node != null, "node != null"); return(node.Accept(this)); }
public IProjection Visit(QueryNode queryNode) { return(queryNode.Accept <IProjection>(this)); }
public ICriterion Visit(QueryNode queryNode) { return(queryNode.Accept <ICriterion>(this)); }
/// <summary> /// Main dispatching visit method for validating query-nodes. /// </summary> /// <remarks> /// Type references are not validated as nullability is only meaningful in context of the element /// Types are validated for each element if the element defines the type (i.e., property, cast, function,...) /// </remarks> /// <param name="node">The node to visit/translate.</param> /// <returns>bool indicating whether or not any errors were found.</returns> public bool ValidateNode(QueryNode node) { return(node.Accept(this)); }
public static FilterDefinition <T> Visit(QueryNode node, ConvertProperty propertyCalculator, ConvertValue convertValue) { var visitor = new FilterVisitor <T>(propertyCalculator, convertValue); return(node.Accept(visitor)); }
/// <summary> /// Main dispatching visit method for translating query nodes into expressions. /// </summary> /// <param name="node">The node to visit/translate.</param> /// <returns>The LINQ expression resulting from visiting the node.</returns> internal Expression TranslateNode(QueryNode node) { this.CheckArgumentNull(node, "QueryNode"); return(node.Accept(this)); }
public Expression TranslateNode(QueryNode node) { return(node.Accept(this)); }
public static ClrValue Visit(QueryNode node) { return(node.Accept(Instance)); }
public int TranslateNode(QueryNode node) { return(node.Accept(this)); }
public static string ToLogString(this QueryNode node) { return(node.Accept(new QueryNodeToStringVisitor())); }
public static FilterNode Visit(QueryNode node) { return(node.Accept(Instance)); }
/// <summary> /// Main dispatching visit method for translating query-nodes into expressions. /// </summary> /// <param name="node">The node to visit/translate.</param> /// <returns>The LINQ String resulting from visiting the node.</returns> internal String TranslateNode(QueryNode node) { Debug.Assert(node != null, "node != null"); return(node.Accept(this)); }
public static FilterDefinition <T> Visit(QueryNode node, PropertyCalculator propertyCalculator) { var visitor = new FilterVisitor <T>(propertyCalculator); return(node.Accept(visitor)); }