The method parameter needs to be a Functional interface of the type of the method reference.
MyMethod(() -> "Hello, World!");
Supplier<String> supplier = () -> "Hello, World!";
MyMethod(supplier);
MyMethod(supplier::get);
MyMethod2(supplier.get());
public static void MyMethod(Supplier<String> sup) {
System.out.println(sup.get());
}
public static void MyMethod2(String value) {
System.out.println(value);
}
prints
Hello, World!
Hello, World!
Hello, World!
Hello, World!
Answer from WJS on Stack OverflowTo convert a Linq query to it's Lambda equivalent:
- Download Linqpad and run your query.
- In the results window, click on the "λ" button in the toolbar. It's right above the Results window
- Your query will be converted to a Lambda expression equivalent!

You can take a look at 101 LINQ Samples and C# 3.0 QUERY EXPRESSION TRANSLATION CHEAT SHEET
You must assign the lambda to a different type:
// Gives you a delegate:
Func<int, int> f = x => x * 2;
// Gives you an expression tree:
Expression<Func<int, int>> g = x => x * 2;
The same goes for method arguments. However, once you've assigned such a lambda expression to a Func<> type, you can't get the expression tree back.
Konrad's reply is exact. You need to assign the lambda expression to Expression<Func<...>> in order for the compiler to generate the expression tree. If you get a lambda as a Func<...>, Action<...> or other delegate type, all you have is a bunch of IL instructions.
If you really need to be able to convert an IL-compiled lambda back into an expression tree, you'd have to decompile it (e.g. do what Lutz Roeder's Reflector tool does). I'd suggest having a look at the Cecil library, which provides advanced IL manipulation support and could save you quite some time.