|
public void InvokeGenericMethod(object o)
{
Func<string, string> temp = MyGenericTestMethod<string>;
MethodInfo mi = temp.Method.GetGenericMethodDefinition();
mi = mi.MakeGenericMethod(new Type[] { o.GetType() });
mi.Invoke(this, new object[] { o });
}
private string MyGenericTestMethod<T>(T value)
{
return value.GetType().ToString();
}
|