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

Exception in System.Linq.Dynamic.Core.Parser.EnumerationsFromMscorlib after update to 1.2.6 #473

Closed
ratamahatta88 opened this issue Dec 23, 2020 · 2 comments
Labels

Comments

@ratamahatta88
Copy link

Hello friends. We have xamarin forms application, and after updating to 1.2.6 we see the exception
The type initializer for 'System.Linq.Dynamic.Core.Parser.EnumerationsFromMscorlib' threw an exception.
Stack trace:

  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_generic_class_init(intptr)
  at System.Linq.Dynamic.Core.Parser.KeywordsHelper..ctor (System.Linq.Dynamic.Core.ParsingConfig config) [0x00256] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\KeywordsHelper.cs:68 
  at System.Linq.Dynamic.Core.Parser.ExpressionParser..ctor (System.Linq.Expressions.ParameterExpression[] parameters, System.String expression, System.Object[] values, System.Linq.Dynamic.Core.ParsingConfig parsingConfig) [0x0007c] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\Parser\ExpressionParser.cs:84 
  at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda (System.Type delegateType, System.Linq.Dynamic.Core.ParsingConfig parsingConfig, System.Boolean createParameterCtor, System.Linq.Expressions.ParameterExpression[] parameters, System.Type resultType, System.String expression, System.Object[] values) [0x00027] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicExpressionParser.cs:120 
  at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda (System.Linq.Dynamic.Core.ParsingConfig parsingConfig, System.Boolean createParameterCtor, System.Linq.Expressions.ParameterExpression[] parameters, System.Type resultType, System.String expression, System.Object[] values) [0x00000] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicExpressionParser.cs:97 
  at System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda (System.Linq.Dynamic.Core.ParsingConfig parsingConfig, System.Boolean createParameterCtor, System.Type itType, System.Type resultType, System.String expression, System.Object[] values) [0x00019] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicExpressionParser.cs:355 
  at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where (System.Linq.IQueryable source, System.Linq.Dynamic.Core.ParsingConfig config, System.String predicate, System.Object[] args) [0x0002c] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicQueryableExtensions.cs:2661 
  at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource] (System.Linq.IQueryable`1[T] source, System.Linq.Dynamic.Core.ParsingConfig config, System.String predicate, System.Object[] args) [0x00000] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicQueryableExtensions.cs:2628 
  at System.Linq.Dynamic.Core.DynamicQueryableExtensions.Where[TSource] (System.Linq.IQueryable`1[T] source, System.String predicate, System.Object[] args) [0x00000] in C:\Users\azurestef\Documents\Github\zzzprojects\System.Linq.Dynamic.Core\src\System.Linq.Dynamic.Core\DynamicQueryableExtensions.cs:2634 
  at ----.Services.Data.Repositories.Repository`1[T].MergeAll (System.Collections.Generic.IList`1[T] newEntities, ---.Services.Data.Repositories.MergeConditionProperty[] conditions) [0x00318] in -----/Services/Data/Repositories/Repository.cs:356 

The strings causing the exception and the value looks like this:

var wherePredicate = "TicketGroups.Contains(1) and TicketRanges.Contains(0) and SupportGroups.Contains(0)";
var allEntitiesQueryable = realm.All<T>().ToList().AsQueryable();
var allEntities = allEntitiesQueryable.Where(wherePredicate);  <- exception here
@StefH
Copy link
Collaborator

StefH commented Dec 23, 2020

Hello @ratamahatta88 , this issue could be related to:
#465

Can you take a look and try the preview version mentioned there?

@StefH StefH added the bug label Dec 25, 2020
@StefH StefH closed this as completed Dec 25, 2020
@ratamahatta88
Copy link
Author

Thank you, I see a new version is released.

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