I have a method in class A
public IList<T> MyMethod<T>() where T:AObject
I want to call this method in another generic class B. This is T without any restrictions.
public mehtodInClassB(){ if (typeof(AObject)==typeof(T)) {
Class C inherits from class AObject.
B<C> b = new B<C>(); b.mehtodInClassB()
any thoughts?
After the urs remind ... Update:
Yes. I really want to do
typeof(AObject).IsAssignableFrom(typeof(T))
not
typeof(AObject)==typeof(T))
ValidfroM
source share