Something like this:
var myObject = new MyClass()
{
x = \" \".Select(y =>
{
//Do stuff..
if (2 + 2 == 5)
return \"I like c
For some reason it's really hard to get implicitly typed delegates, but it's not impossible if you write your own static methods for it.
public static class Func {
public static Func Create(
Func pFunc
) =>
pFunc;
}
...
x = Func.Create(() => "result")();
x = Func.Create(() => {
// complex logic to create a value
})();