Possible Duplicate:
Calling generic method with a type argument known only at execution time
I have a generic method and I want it to call it with a already known Type-Object in Runtime.
public class someClass {
public void someGenericMethod<T>()
{
//some Code to Execute
}
public void someMthod()
{
Type objectType = someInstance.getType();
someGenericMethod<objectType>(); //this isn't valid code, but I want to do something like this.
}
}
Is there a way to do this in C#/.net or is there a workaround?