Table of Contents

Class SourceGenObjectTypeShape<TObject>

Namespace
PolyType.SourceGenModel
Assembly
PolyType.dll

Source generator model for object type shapes.

public sealed class SourceGenObjectTypeShape<TObject> : SourceGenTypeShape<TObject>, IObjectTypeShape<TObject>, ITypeShape<TObject>, IObjectTypeShape, ITypeShape

Type Parameters

TObject

The type whose shape is described.

Inheritance
SourceGenObjectTypeShape<TObject>
Implements
ITypeShape<TObject>
Inherited Members
Extension Methods

Properties

Constructor

Gets the constructor shape for the given type, if available.

public IConstructorShape? Constructor { get; }

Property Value

IConstructorShape

An IConstructorShape representation of the constructor.

CreateConstructorFunc

Gets the factory method for creating constructor shapes.

public Func<IConstructorShape>? CreateConstructorFunc { get; init; }

Property Value

Func<IConstructorShape>

CreatePropertiesFunc

Gets the factory method for creating property shapes.

public Func<IEnumerable<IPropertyShape>>? CreatePropertiesFunc { get; init; }

Property Value

Func<IEnumerable<IPropertyShape>>

IsRecordType

Gets a value indicating whether the current shape represents a C# record type.

public required bool IsRecordType { get; init; }

Property Value

bool

IsTupleType

Gets a value indicating whether the current shape represents a tuple type, either Tuple or ValueTuple.

public required bool IsTupleType { get; init; }

Property Value

bool

Kind

Gets determines the TypeShapeKind that the current shape supports.

public override TypeShapeKind Kind { get; }

Property Value

TypeShapeKind

Properties

Gets all available property/field shapes for the given type.

public IReadOnlyList<IPropertyShape> Properties { get; }

Property Value

IReadOnlyList<IPropertyShape>

An enumeration of all available property/field shapes.

Methods

Accept(TypeShapeVisitor, object?)

Accepts an TypeShapeVisitor for strongly-typed traversal.

public override object? Accept(TypeShapeVisitor visitor, object? state = null)

Parameters

visitor TypeShapeVisitor

The visitor to accept.

state object

The state parameter to pass to the underlying visitor.

Returns

object

The object result returned by the visitor.