Click or drag to resize

ExtensionsInheritsFrom Method

Verifies whether a given type inherits from another type. This covers the inheritance from a base generic type.
MyGenericType<int> inherits from MyGenericType <>

Namespace: RAYLASE.Shared
Assembly: RAYLASE.Shared (in RAYLASE.Shared.dll) Version: 2.19.0
Syntax
C#
public static (bool IsInherited, Type ClosestBaseType) InheritsFrom(
	this Type type,
	Type baseType
)

Parameters

type  Type
The type to be checked.
baseType  Type
The base type.

Return Value

ValueTupleBoolean, Type
Tuple of:
Item1 = true if types are inherited.
Item2 = the closest base type from the given base type.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also