I
I
i__egor2021-06-22 07:46:10
C++ / C#
i__egor, 2021-06-22 07:46:10

How to check that a given interface type is a successor of a certain base one?

How to check that a given interface type is a successor of a certain base one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soloveid, 2021-06-22
@soloveid

IMyInterface is IBaseInterface

V
Vasily Bannikov, 2021-06-22
@vabka

public IEnumerable<Type> GetInterfaces(Type type, Type except) =>
  type.GetInterfaces().Where(x => x != except && type.IsAssignableTo(except));

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question