public override object Visit(Mono.CSharp.Linq.Where where) { var result = new QueryWhereClause(); result.AddChild(new CSharpTokenNode(Convert(where.Location), QueryWhereClause.WhereKeywordRole), QueryWhereClause.WhereKeywordRole); if (where.Expr != null) result.AddChild((Expression)where.Expr.Accept(this), Roles.Condition); return result; }
public virtual void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { if (this.ThrowException) { throw (Exception)this.CreateException(queryWhereClause); } }
public override object Visit (Mono.CSharp.Linq.Where w) { var result = new QueryWhereClause (); var location = LocationsBag.GetLocations (w); if (location != null) result.AddChild (new CSharpTokenNode (Convert (location[0]), "where".Length), QueryWhereClause.Roles.Keyword); result.AddChild ((Expression)w.Expr.Accept (this), QueryWhereClause.Roles.Condition); return result; }
public override void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { base.VisitQueryWhereClause(queryWhereClause); indexData.HasWhere = true; }
public StringBuilder VisitQueryWhereClause(QueryWhereClause queryWhereClause, int data) { throw new SLSharpException("SL# does not understand LINQ."); }
public JsNode VisitQueryWhereClause(QueryWhereClause node) { throw new NotImplementedException(); }
public override void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { FixClauseIndentation(queryWhereClause, queryWhereClause.WhereKeyword); }
public void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { throw new NotImplementedException(); }
public void VisitQueryWhereClause(QueryWhereClause node) { NotSupported(node); }
public RedILNode VisitQueryWhereClause(QueryWhereClause queryWhereClause, State data) { throw new System.NotImplementedException(); }
public StringBuilder VisitQueryWhereClause(QueryWhereClause queryWhereClause, int data) { throw new ASLException("ASL does not understand LINQ."); }
public virtual Node VisitQueryWhereClause(QueryWhereClause queryWhereClause) { throw new System.NotImplementedException(); }
public override void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { }
public override void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { base.VisitQueryWhereClause(queryWhereClause); indexData.HasWhere = true; }
public virtual void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { VisitChildren (queryWhereClause); }
public void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { throw new NotImplementedException(); }
public void VisitQueryWhereClause(QueryWhereClause queryWhereClause) { StartNode(queryWhereClause); WriteKeyword(QueryWhereClause.WhereKeywordRole); Space(); queryWhereClause.Condition.AcceptVisitor(this); EndNode(queryWhereClause); }
private static void HandleCollectionName(Expression expression, QueryFromClause fromClause, QueryExpression queryExpression, ref string entityName) { // from d in docs.Users.SelectMany(x=>x.Roles) ... // from d in docs.Users.Where(x=>x.IsActive) ... var mie = expression as InvocationExpression; string methodToCall = null; if (mie != null) { expression = mie.Target; var target = expression as MemberReferenceExpression; if (target != null) { methodToCall = target.MemberName; expression = target.Target; } } var mre = expression as MemberReferenceExpression; if (mre == null) { return; } string oldIdentifier = fromClause.Identifier; if (mie != null) { fromClause.Identifier += "Item"; } entityName = mre.MemberName; fromClause.Expression = mre.Target; //doc["@metadata"]["Raven-Entity-Name"] var metadata = new IndexerExpression( new IndexerExpression(new IdentifierExpression(fromClause.Identifier), new List <Expression> { new StringLiteralExpression("@metadata") }), new List <Expression> { new StringLiteralExpression(Constants.RavenEntityName) } ); // string.Equals(doc["@metadata"]["Raven-Entity-Name"], "Blogs", StringComparison.OrdinalIgnoreCase) var binaryOperatorExpression = new InvocationExpression( new MemberReferenceExpression(new TypeReferenceExpression(new PrimitiveType("string")), "Equals"), new List <Expression> { metadata, new StringLiteralExpression(mre.MemberName), new MemberReferenceExpression(new TypeReferenceExpression(new SimpleType(typeof(StringComparison).FullName)), "InvariantCultureIgnoreCase") }); var queryWhereClause = new QueryWhereClause { Condition = binaryOperatorExpression }; ((QueryExpression)fromClause.Parent).Clauses.InsertAfter(fromClause, queryWhereClause); if (mie != null) { var newSource = new ArrayCreateExpression { Initializer = new ArrayInitializerExpression(new IdentifierExpression(fromClause.Identifier)), AdditionalArraySpecifiers = { new ArraySpecifier(1) } }; queryExpression.Clauses.InsertAfter(queryWhereClause, new QueryFromClause { Identifier = oldIdentifier, Expression = new InvocationExpression(new MemberReferenceExpression(newSource, methodToCall), mie.Arguments.Select(x => x.Clone())) }); } }