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.SharedAssembly: RAYLASE.Shared (in RAYLASE.Shared.dll) Version: 2.19.0
Syntaxpublic 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,
TypeTuple 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