Table of Contents

Interface IEnumerableTypeShape

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

Provides a strongly typed shape model for a .NET type that is enumerable.

public interface IEnumerableTypeShape : ITypeShape
Inherited Members

Remarks

Typically covers all types implementing IEnumerable<T> or IEnumerable.

Properties

ConstructionStrategy

Gets the construction strategy for the given collection.

CollectionConstructionStrategy ConstructionStrategy { get; }

Property Value

CollectionConstructionStrategy

ElementType

Gets the shape of the underlying element type.

ITypeShape ElementType { get; }

Property Value

ITypeShape

Remarks

For non-generic IEnumerable this returns the shape for object.

IsAsyncEnumerable

Indicates whether the underlying type is an IAsyncEnumerable.

bool IsAsyncEnumerable { get; }

Property Value

bool

Remarks

Calling GetGetEnumerable() on async enumerable instances will result in an exception being thrown to prevent accidental sync-over-async. Users should manually cast instances to IAsyncEnumerable and enumerate elements asynchronously.

Rank

Gets the rank of the enumerable, if a multidimensional array.

int Rank { get; }

Property Value

int