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
{{ message }}
Repository navigation
Custom extension not working when using IEnumerable<T> #982
IEnumerable<Person>data=newList<Person>{newPerson{Name="Alice",Age=30},newPerson{Name="Bob",Age=25},newPerson{Name="Charlie",Age=35}};IEnumerable<House>houses=newList<House>{newHouse{Persons=newList<Person>{newPerson{Name="Alice",Age=30},newPerson{Name="Bob",Age=25},newPerson{Name="Charlie",Age=35}}},newHouse{Persons=newList<Person>{newPerson{Name="Dave",Age=40},newPerson{Name="Eve",Age=28}}}};// Configure Dynamic LINQ to use our custom type providervarconfig=newParsingConfig{CustomTypeProvider=newMyCustomTypeProvider(),};stringfilter="a => a.Name.IsEmpty()";System.Linq.Expressions.Expression<Func<House,bool>>expression=System.Linq.Dynamic.Core.DynamicExpressionParser.ParseLambda<House,bool>(config,false,filter);Func<House,bool>function=expression.Compile();
The filter "a => a.Name.IsEmpty()"; does not compile with error System.Linq.Dynamic.Core.Exceptions.ParseException: 'No applicable method 'IsEmpty' exists in type 'String''
The filter "a => GenericExtensions.IsEmpty(a.Name)"; compiles OK.
The filter "a => GenericExtensions.HasOne(a.Persons)"; compiles OK
The filter "a => GenericExtensions.HasOneGeneric(a.Persons)"; does not compile with error System.Linq.Dynamic.Core.Exceptions.ParseException: 'No applicable method 'HasOneGeneric' exists in type 'GenericExtensions''
Activity