Construct a function at runtime in C#
Lambda expressions are evaluated at compile time, so the below code will
not generate a 100 different functions. Is there a simple mechanism to
achieve the mentioned effect? I realize this isn't very efficient
performance wise.
List<Action> actions = new List<Action>();
for (int i = 0; i < 100; ++i)
actions.Add(() => Execute(100100100 + i));
No comments:
Post a Comment