You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling OfType() when AllowNewToEvaluateAnyType is true fails on version 1.2.24 and above; it works on 1.2.23.
Here's a repro:
usingSystem.Linq.Dynamic.Core;namespaceDynamicLinqExample{internalclassBase{}internalclassDerivedA:Base{}internalclassDerivedB:Base{}internalclassParent{publicIEnumerable<Base>Children{get;set;}}internalclassProgram{privatestaticreadonlyParsingConfigDefaultParsingConfig=new(){AllowNewToEvaluateAnyType=true,// <-- works if this is false};staticvoidMain(string[]args){vardata=newParent[]{new(){Children=newBase[]{newDerivedA(),newDerivedB(),}}};varquery=data.AsQueryable().Select(DefaultParsingConfig,"Children.OfType(\"DynamicLinqExample.DerivedA\")");varresult=query.ToDynamicArray();}}}
This results in:
System.Linq.Dynamic.Core.Exceptions.ParseException
HResult=0x80131500
Message='.' or '(' or string literal expected
Source=System.Linq.Dynamic.Core
StackTrace:
at System.Linq.Dynamic.Core.Tokenizer.TextParser.ValidateToken(TokenId tokenId, String errorMessage)
Thanks!
The text was updated successfully, but these errors were encountered:
@StefH Thanks for the quick response! The code I posted fails for me on version 1.3.1, which is the latest version in NuGet. I also checked MyGet and I don't see any version newer than 1.3.1. To which version are you referring as the latest?
Calling
OfType()
whenAllowNewToEvaluateAnyType
is true fails on version 1.2.24 and above; it works on 1.2.23.Here's a repro:
This results in:
Thanks!
The text was updated successfully, but these errors were encountered: