H
Henri.Chinasque
Hi all,
I've tried searching for this one, but can't seem to come up with the
proper terms.
I want to know how to pass a type to a generic method. Something like
this:
public void MyMethod(Type objType){
DoSomething<objType>();
}
This of course doesn't compile, any ideas what I can do to get it to
work?
DoSomething is just a generic method
public void DoSomething<T>(){
Console.WriteLine("Do Something");
}
thanks,
Henri
I've tried searching for this one, but can't seem to come up with the
proper terms.
I want to know how to pass a type to a generic method. Something like
this:
public void MyMethod(Type objType){
DoSomething<objType>();
}
This of course doesn't compile, any ideas what I can do to get it to
work?
DoSomething is just a generic method
public void DoSomething<T>(){
Console.WriteLine("Do Something");
}
thanks,
Henri