Похожие чаты

Why don't method groups work with Linq Expressions? Argument type 'method

group' is not assignable to parameter type 'System.Linq.Expressions.Expression<System.Func<string,bool>>'

2 ответов

19 просмотров

Because there are multiple methods with different signature and it basically doesn't know which one is the one you need

JosXa- Автор вопроса

Thanks @sossenbinder: "Because, in order to get the expression tree, we need a representation of the method in (uncompiled) source form. Lambda expressions are locally available in the source code and therefore are always available uncompiled. But methods may not be from inside the current assembly, and may thus be available only in compiled form. Granted, the C# compiler could decompile the assembly’s IL code to retrieve an expression tree but as you mentioned, implementing feature costs money, this particular feature isn’t trivial, and the benefits are unclear."

Похожие вопросы

Обсуждают сегодня

Карта сайта