Yada.DoSomething() fails with compiler error, but yada.DoSomething() works fine.
I can pass a “Method” directly into any method expecting a Func, except extension methods.
I get the argument that – sometimes – it’s appropriate to be more explicit, but this just seems silly.
public static class BlahYada_Test
{
public static void DoSomething<TResult>(this Func<TResult> func)
{ }
public static void Blah()
{
Yada.DoSomething(); // <-- Fails
var yada = Yada;
yada.DoSomething(); // <-- Works
}
public static string Yada()
{
return "Hello";
}
}