Type.GetInterfaces () workaround for .NET Standard 1.x

.NET Core 1.1supports a method Type.GetInterfaces()that provides a list of interfaces implemented in this type. Sorry, Type.GetInterfaces()not yet available at .NET Standard 1.x.

The good news is what is supposed to be included in .NET Standard 2.0.

In the meantime, does anyone know of a workaround that I can use to get a list of interfaces for the type and / or list of classes that implement this interface in .NET Standard 1.x?

Many thanks!

+6
source share
1 answer

. GetTypeInfo() - System.Reflection, InstrospectionExtensions.

using System.Reflection;
var interfaces = typeof({SOME_TYPE}).GetTypeInfo().GetInterfaces();
+8

All Articles