Table of Contents

Interface ITypeShape

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

Provides a strongly typed shape model for a given .NET type.

public interface ITypeShape

Properties

AttributeProvider

The provider used for type-level attribute resolution.

ICustomAttributeProvider? AttributeProvider { get; }

Property Value

ICustomAttributeProvider

Kind

Determines the TypeShapeKind that the current shape supports.

TypeShapeKind Kind { get; }

Property Value

TypeShapeKind

Provider

The provider used to generate this instance.

ITypeShapeProvider Provider { get; }

Property Value

ITypeShapeProvider

Type

The underlying Type that this instance represents.

Type Type { get; }

Property Value

Type

Methods

Accept(ITypeShapeVisitor, object?)

Accepts an ITypeShapeVisitor for strongly-typed traversal.

object? Accept(ITypeShapeVisitor visitor, object? state = null)

Parameters

visitor ITypeShapeVisitor

The visitor to accept.

state object

The state parameter to pass to the underlying visitor.

Returns

object

The object result returned by the visitor.

Invoke(ITypeShapeFunc, object?)

Invokes the specified generic function with the given state.

object? Invoke(ITypeShapeFunc function, object? state = null)

Parameters

function ITypeShapeFunc

The generic function to be invoked.

state object

The state to be passed to the function.

Returns

object

The result produced by the function.