In VB.NET can you do an arbitary code block?

vb.net

Solution

Yes it's possible to introduce arbitrary blocks into VB.Net

If True Then
  ...
End If

In Visual Studio 2008 though you cannot do this for lambda expressions. Vb.Net only supports single expression lambdas in Visual Studio 2008. Statement lambdas were not added until Visual Studio 2010. There is no way to get that style of block functionality into an expression lambda using 2008 constructs.

Problem

probably a trivially easy thing to do... In C# you can introduce a block simply by putting in { } eg. if you wanted to do a lambda like x => { var x="x"; var y="y"; } so is there a way to introduce a scope / block in VB.NET?

Original source