Table of Contents

Class EnumerableDataModel

Namespace
PolyType.Roslyn
Assembly
PolyType.Roslyn.dll

List-like data model for types implementing IEnumerable that are not dictionaries or are Span<T>, ReadOnlySpan<T>, Memory<T> or ReadOnlyMemory<T>.

public sealed class EnumerableDataModel : TypeDataModel
Inheritance
EnumerableDataModel
Inherited Members

Properties

AppendMethod

Instance method used for appending an element to the collection. Implies that the collection also has an accessible default constructor.

public required IMethodSymbol? AppendMethod { get; init; }

Property Value

IMethodSymbol

ElementType

The element type of the enumerable. Typically the type parameter of the implemented IEnumerable<T> interface or object if using the non-generic IEnumerable.

public required ITypeSymbol ElementType { get; init; }

Property Value

ITypeSymbol

EnumerableKind

Gets the kind of enumerable model.

public required EnumerableKind EnumerableKind { get; init; }

Property Value

EnumerableKind

FactoryMethod

Constructor or static factory method for the collection.

public required IMethodSymbol? FactoryMethod { get; init; }

Property Value

IMethodSymbol

FactorySignature

The inferred signature of the factory method or constructor.

public required ImmutableArray<CollectionConstructorParameter> FactorySignature { get; init; }

Property Value

ImmutableArray<CollectionConstructorParameter>

InsertionMode

Gets the insertion mode supported by the enumerable type if mutable.

public required EnumerableInsertionMode InsertionMode { get; init; }

Property Value

EnumerableInsertionMode

IsSetType

Indicates whether the enumerable is a known set type.

public required bool IsSetType { get; init; }

Property Value

bool

Kind

Determines the type of TypeDataModel being used.

public override TypeDataKind Kind { get; }

Property Value

TypeDataKind

Length

The length of the array if it is an inline array.

public int? Length { get; init; }

Property Value

int?

Rank

If the enumerable is an array, the rank of the array.

public required int Rank { get; init; }

Property Value

int