-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Hey, awesome library. I just replaced LinqKit with it 😃
There might be an issue with method groups inside projectables.
If you do the following inside a Projectable it fails because method groups are converted to Func<> instead of Expression<> :
entity.Collection.Select(MapChildren) // Collection is an IEnumerable and MapChildren is another ProjectableError message:
System.ArgumentException: Expression of type 'System.Func`2[Participant,Substitutes.SubstitutedParticipantRecord]' cannot be used for parameter of type 'System.Linq.Expressions.Expression`1[System.Func`2[Participant,Substitutes.SubstitutedParticipantRecord]]' of method 'System.Linq.IQueryable`1[Substitutes.SubstitutedParticipantRecord] Select[Participant,SubstitutedParticipantRecord](System.Linq.IQueryable`1[Participant], System.Linq.Expressions.Expression`1[System.Func`2[Participant,Substitutes.SubstitutedParticipantRecord]])' (Parameter 'arg1')
at System.Dynamic.Utils.ExpressionUtils.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arguments, ParameterInfo pi, String methodParamName, String argumentParamName, Int32 index)
at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, Expression arg0, Expression arg1)So it's kind of a C#/EF limitation but it might be worth rewritting Projectables that use method groups. Also Rider for example offers a quick fix to replace calls with method group. Which makes it even more confusing/error prone.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed