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

Gets the provider used for type-level attribute resolution.

ICustomAttributeProvider? AttributeProvider { get; }

Property Value

ICustomAttributeProvider

Kind

Gets determines the TypeShapeKind that the current shape supports.

TypeShapeKind Kind { get; }

Property Value

TypeShapeKind

Provider

Gets the provider used to generate this instance.

ITypeShapeProvider Provider { get; }

Property Value

ITypeShapeProvider

Type

Gets 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 func, object? state = null)

Parameters

func 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.