What is the equivalent C# code for the following VB.NET:
Dim moo = Function(x as String) x.ToString()
I thought that this should work:
var moo = (string x) => x.ToString();
but that yielded a compiler error: Cannot assign lamda expression to an implicitly-typed local variable
After some further investigation, I discovered that the type of the variable moo
(moo.GetType()
) in the VB example is VB$AnonymousDelegate_0'2[System.String,System.String]
Is there anything equivalent to this in C#?