<PackageReference Include="NJsonSchema" Version="5.4.6138.24413" />

ReflectionExtensions

public static class ReflectionExtensions
Provides extension methods for reflection.
public static Type GetEnumerableItemType(this Type type)

Gets the type of the array item.

public static Type[] GetGenericTypeArguments(this Type type)

Gets the generic type arguments of a type.

public static bool InheritsFrom(this Type type, string typeName, TypeNameStyle typeNameStyle)

Checks whether the given type inherits from the given type name.

public static bool IsAssignableTo(this Type type, string typeName, TypeNameStyle typeNameStyle)

Checks whether the given type is assignable to the given type name.

public static T TryGetByObjectType<T>(this IEnumerable<T> attributes, string typeName, TypeNameStyle typeNameStyle = 1)

Tries to get the first object of the given type name.

public static T TryGetIfAssignableTo<T>(this IEnumerable<T> attributes, string typeName, TypeNameStyle typeNameStyle = 1)

Tries to get the first object which is assignable to the given type name.