B
Bilz
Ok, lets say I have a generic method:
public T Testing<T>() : where T:class
{
T myT = getStuff() as T;
// Do something with myT
return myT;
}
How do I call it dynamically? The following code does not work, but is
there any way to do it? My understnding of C# generics tells me that I
can... It is not compile-time like C++... I just don't know how.
public object Helper(Type t)
{
return Testing<t>();
}
Help is appreciated
public T Testing<T>() : where T:class
{
T myT = getStuff() as T;
// Do something with myT
return myT;
}
How do I call it dynamically? The following code does not work, but is
there any way to do it? My understnding of C# generics tells me that I
can... It is not compile-time like C++... I just don't know how.
public object Helper(Type t)
{
return Testing<t>();
}
Help is appreciated