2
The question is simple. There is a keyword equivalent to Call
of Visual Basic.NET in C#?
In Visual Basic, I called a class method without having to declare a member explicitly to it:
Call New Form() With {.Text = "Olá, mundo!"}.ShowDialog()
All this above would be the equivalent of this in C#:
Form tmp = new Form() { Text = "Olá, mundo!" };
tmp.ShowDialog();
tmp.Dispose();
I find this keyword very useful because it saves space in code, organization and memory management, because it discards the objects used after the end of use.
Is there any way to call a member, lambda, or procedure that the Call
does, but in C#?