Avoid reflection in Hot Paths
In this section you can read about reflection and when it should be avoided.
Performance
Activator.CreateInstance("MyCOMObject");public string MyMethod(object myObject)
{
return myObject.GetType().GetMethod("MyMethod").
Invoke(myObject,null).ToString();
}public string MyMethod(MyClass myObject)
{
return myObject.MyMethod();
}Last updated
Was this helpful?