Can I dynamically create a function and invoke it (passing values into it) in one line of code?
Clarification: I was looking for some way that could allow me to create an anonymous function and then calling it directly. Sort of:
delegate(string aa){ MessageBox.show(aa); }('Hello World!');
or something like that (I know the above code does not compile, but I wanted something close).
it’s not so readable but answering your question, you definitely can.
EDIT: just noticed you tagged it as c# 2.0, the answer above is for 3.5, for 2.0 it would be