vendredi 25 août 2017

C# reflection - can't check nested base type

I have a problem with checking if in the inheritance of my class, the inherited class implements some interface

public interface IUserClass : IBaseInterface<T, K> { }
public class UserClass : BaseClass<A, B>, IUserClass { }

and I check

typeof(UserClass).IsAssignableFrom(typeof(IBaseInterface <,>))

and I get false. Even if I do

typeof(UserClass).IsSubclassOf(typeof(BaseClass<,>))

i get the same result Why ?





Aucun commentaire:

Enregistrer un commentaire