Table of Contents

Interface IType

Namespace
LinqToDB.CodeModel
Assembly
linq2db.Tools.dll

Type descriptor interface.

public interface IType
Extension Methods

Properties

ArrayElementType

Type of array element for array type.

IType? ArrayElementType { get; }

Property Value

IType

ArraySizes

Optional array sizes for array type. Use array as property type to support multi-dimensional arrays.

IReadOnlyList<int?>? ArraySizes { get; }

Property Value

IReadOnlyList<int?>

External

Returns true if type defined in external code and false, when type defined in current AST (as class).

bool External { get; }

Property Value

bool

IsNullable

Type nullability. E.g. NRT annotation status for reference type and Nullable`T wrapper presence for value type.

bool IsNullable { get; }

Property Value

bool

IsValueType

Value or reference type.

bool IsValueType { get; }

Property Value

bool

Kind

Type kind.

TypeKind Kind { get; }

Property Value

TypeKind

Name

Type name.

CodeIdentifier? Name { get; }

Property Value

CodeIdentifier

Namespace

Type namespace.

IReadOnlyList<CodeIdentifier>? Namespace { get; }

Property Value

IReadOnlyList<CodeIdentifier>

OpenGenericArgCount

Number of type arguments for open generic type.

int? OpenGenericArgCount { get; }

Property Value

int?

Parent

Parent type for nested types.

IType? Parent { get; }

Property Value

IType

TypeArguments

Type arguments for generic type.

IReadOnlyList<IType>? TypeArguments { get; }

Property Value

IReadOnlyList<IType>

Methods

WithNullability(bool)

Apply nullability flag to current type.

IType WithNullability(bool nullable)

Parameters

nullable bool

New type nullability status.

Returns

IType

New type instance if nullability changed.

WithTypeArguments(params IType[])

Specify type arguments for open generic type. Method call valid only on open-generic types.

IType WithTypeArguments(params IType[] typeArguments)

Parameters

typeArguments IType[]

Types to use as generic type arguments.

Returns

IType

Generic type with provided type arguments.