I have a class
public class A
{
public static string B(T obj)
{
return TransformThisObjectToAString(obj);
}
}
The
Trying to substitute type parameter at runtime will defeat the whole purpose of type saftey , which is enforced by C# compiler.C# compiler make sures that type parameter are specified at compile time and there is no ambiguity on type arguments at runtime.I doubt you can substitue type parameter at runtime in Generic Type.Specifying type argument of type "Type" is almost like having an unbound generic type.