C# in Depth

Cover of C# in Depth
Order now (3rd edition)

Another potential shortcut - lambdas with no arguments

Chapter 9: Lambda expressions and expression trees: 9.1.5

Created: 3/3/2008
Last updated: 3/3/2008

Although C# 3 has a shortcut for the case of a single argument, it has no parallel for a lambda which doesn't need any arguments. For instance, a Func<int> might be created from: () => 5. There are numerous possible representations. Two which spring to mind are |> 5 and |=> 5, using the vertical bar as a sort of "no data here" symbol.