TypeBuilder.IsAssignableFrom Method

Definition

Determines whether a specified type can be assigned to this object.

Overloads

IsAssignableFrom(TypeInfo)

Gets a value that indicates whether a specified TypeInfo object can be assigned to this object.

IsAssignableFrom(Type)

Gets a value that indicates whether a specified Type can be assigned to this object.

IsAssignableFrom(TypeInfo)

Source:
TypeBuilder.cs

Gets a value that indicates whether a specified TypeInfo object can be assigned to this object.

C#
public override bool IsAssignableFrom(System.Reflection.TypeInfo? typeInfo);
C#
public override bool IsAssignableFrom(System.Reflection.TypeInfo typeInfo);

Parameters

typeInfo
TypeInfo

The object to test.

Returns

true if typeInfo can be assigned to this object; otherwise, false.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 1.0, Core 1.1, 6, 7, 8, 9, 10
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

IsAssignableFrom(Type)

Source:
TypeBuilder.cs

Gets a value that indicates whether a specified Type can be assigned to this object.

C#
public override bool IsAssignableFrom(Type? c);
C#
public override bool IsAssignableFrom(Type c);

Parameters

c
Type

The object to test.

Returns

true if the c parameter and the current type represent the same type, or if the current type is in the inheritance hierarchy of c, or if the current type is an interface that c supports. false if none of these conditions are valid, or if c is null.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1