For example:
public class MyClass
{
string stuff = "";
public doStuff(string stuff)
{
this.stuff = stuff;
}
}
public static Main()
{
string methodName = "doStuff";
List<MyClass> classList = new List<MyClass>();
for(int i = 0;i < 100;i++)
{
classList.Add(new MyClass);
}
foreach(MyClass class in classList)
{
class.Invoke(methodName, new object[]{randomString})
}
}
And so every MyClass's stuff has a different value.
Is there a way I can invoke a method this way using reflection?