Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find ExpressionVisitor.VisistMemberAcess

I am following this blog to try to create an IQueryable provider for MSAccess for a project I am working on at the moment.

I got as far as the page I linked to above, but a couple of pieces of code create classes which inherit from ExpressionVisitor and override its VisitMemberAccess method, in this method for example:

protected override Expression VisitMemberAccess(MemberExpression m)
    {
        if (m.Expression != null && m.Expression.NodeType == ExpressionType.Parameter)
        {
            if (this.sb.Length > 0)
            {
                this.sb.Append(", ");
            }
            this.sb.Append(m.Member.Name);
            return Expression.Convert(Expression.Call(this.row, miGetValue, Expression.Constant(iColumn++)), m.Type);
        }
        else
        {
            return base.VisitMemberAccess(m);
        }
    }

The problem is that this does not compile because the VisitMemberAccess method is not available anymore. I have googled this for a while and found a few references to this method, but they all seem to date back to .NET 3.5 (see here for e.g.).

I would like to know what happened to that method? And more importantly what to do instead of overriding VisitMemberAccess.

like image 742
yu_ominae Avatar asked Feb 18 '23 01:02

yu_ominae


1 Answers

The equivalent method for the .NET 3.5 framework's ExpressionVisitor.VisitMemberAccess in .NET 4.0 is ExpressionVisitor.VisitMember. I'm not sure why they changed the name of the method.

like image 80
jam40jeff Avatar answered Mar 04 '23 11:03

jam40jeff