Open sandboxFocus

Method DerivesFrom

DerivesFrom(INamedType, INamedType, DerivedTypesOptions)

Determines if a type derives from another one, given as an INamedType.

Declaration
public static bool DerivesFrom(this INamedType left, INamedType right, DerivedTypesOptions options = DerivedTypesOptions.All)
Parameters
Type Name Description
INamedType left

The child type.

INamedType right

The base type. It cannot be a generic type instance.

DerivedTypesOptions options

Determine with inheritance relationships should be considered.

Returns
Type Description
bool

DerivesFrom(INamedType, Type, DerivedTypesOptions)

Determines if a type derives from another one, given as a Type.

Declaration
public static bool DerivesFrom(this INamedType left, Type right, DerivedTypesOptions options = DerivedTypesOptions.All)
Parameters
Type Name Description
INamedType left

The child type.

Type right

The base type. It cannot be a generic type instance.

DerivedTypesOptions options

Determine with inheritance relationships should be considered.

Returns
Type Description
bool