Table of Contents

Interface IConstructorShape

Namespace
PolyType.Abstractions
Assembly
PolyType.dll

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

public interface IConstructorShape

Properties

AttributeProvider

The provider used for method-level attribute resolution.

ICustomAttributeProvider? AttributeProvider { get; }

Property Value

ICustomAttributeProvider

DeclaringType

The shape of the declaring type for the constructor.

IObjectTypeShape DeclaringType { get; }

Property Value

IObjectTypeShape

IsPublic

Specifies whether the constructor is declared public.

bool IsPublic { get; }

Property Value

bool

ParameterCount

The total number of parameters required by the constructor.

int ParameterCount { get; }

Property Value

int

Remarks

This number includes both constructor parameters and any available property or field initializers.

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.

GetParameters()

Creates an enumeration of strongly-typed models for the constructor's parameters.

IEnumerable<IConstructorParameterShape> GetParameters()

Returns

IEnumerable<IConstructorParameterShape>

An enumeration of IConstructorParameterShape models.