Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser issue - NullReferenceException #355

Closed
konzen opened this issue Mar 5, 2020 · 5 comments
Closed

Parser issue - NullReferenceException #355

konzen opened this issue Mar 5, 2020 · 5 comments
Labels

Comments

@konzen
Copy link
Contributor

konzen commented Mar 5, 2020

When the type and property have the same name the parser takes the type instead of property.

Sample:

        public class Test
        {
            public int Id { get; set; }

            public string Value { get; set; }
        }

        public class Test2
        {
            public Test Test { get; set; }
        }

        .
        .
        .

        IQueryable<Test2> queryable = ...;
        var result = queryable.Where(parsingConfig, "Test.Id > 1");  // throw System.NullReferenceException
@konzen konzen changed the title Parser issue Parser issue - NullReferenceException Mar 5, 2020
@StefH StefH added the question label Mar 14, 2020
@StefH
Copy link
Collaborator

StefH commented Mar 14, 2020

What if you use

queryable.Where(parsingConfig, "@Test.Id > 1");

@konzen
Copy link
Contributor Author

konzen commented Mar 16, 2020

It worked! But I have no way to force the use of this syntax. I solved it with a small change. Pull request #357

@StefH StefH added bug and removed question labels Mar 16, 2020
@StefH
Copy link
Collaborator

StefH commented Mar 18, 2020

@konzen can you take a look at my review comment please?

@konzen
Copy link
Contributor Author

konzen commented Mar 19, 2020

Changed

@StefH
Copy link
Collaborator

StefH commented Mar 19, 2020

Code merged to master branch, closing this one.

@StefH StefH closed this as completed Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants