Code Monkey home page Code Monkey logo

Comments (5)

alirezanet avatar alirezanet commented on August 16, 2024 1

Hi @MichalVlcek,
The problem is solved in v2.7.2.

thank you for the feedback.

from gridify.

MichalVlcek avatar MichalVlcek commented on August 16, 2024 1

Hello, thanks for quick reaction and fix!

The expression is now generated properly, but unfortunately filtering using that generated expression still doesn't work.

Example:
Mapping and classes are the same as in the example above.

var rootList = new List<Root>()
        {
            new Root()
            {
                Child1 = new Child1()
                {
                    Child2List = new List<Child2>()
                    {
                        new Child2() { Name = "name" },
                        new Child2() { Name = "otherName" }
                    }
                }
            }
       };

Then calling:

rootList.AsQueryable().ApplyFiltering("Child2NameNested=name", mapping).ToList();

Throws this exception:

System.InvalidOperationException: variable 'x.Child1' of type '….Child1' referenced from scope '', but it is not defined
   at System.Linq.Expressions.Compiler.VariableBinder.Reference(ParameterExpression node, VariableStorageKind storage)
   at System.Linq.Expressions.Compiler.VariableBinder.VisitParameter(ParameterExpression node)
   at System.Linq.Expressions.ParameterExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.Compiler.VariableBinder.Visit(Expression node)
   at System.Linq.Expressions.MemberExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.Compiler.VariableBinder.Visit(Expression node)
   at System.Linq.Expressions.ExpressionVisitor.VisitBinary(BinaryExpression node)
   at System.Linq.Expressions.BinaryExpression.Accept(ExpressionVisitor visitor)
   at System.Linq.Expressions.Compiler.VariableBinder.Visit(Expression node)
…

from gridify.

alirezanet avatar alirezanet commented on August 16, 2024

Oh my bad, you're right.
I'll check it out tonight.
thanks

from gridify.

alirezanet avatar alirezanet commented on August 16, 2024

I think I managed to solve the issue, please try v2.7.3 and let me know if the problem is solved.

thank you

from gridify.

MichalVlcek avatar MichalVlcek commented on August 16, 2024

It seems like it works great, thanks :)

from gridify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.