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
-
SourceGenTypeShape<TObject>SourceGenObjectTypeShape<TObject>
- Implements
-
IObjectTypeShape<TObject>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
CreatePropertiesFunc
Gets the factory method for creating property shapes.
public Func<IEnumerable<IPropertyShape>>? CreatePropertiesFunc { get; init; }
Property Value
IsRecordType
Gets a value indicating whether the current shape represents a C# record type.
public required bool IsRecordType { get; init; }
Property Value
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
Kind
Gets determines the TypeShapeKind that the current shape supports.
public override TypeShapeKind Kind { get; }
Property Value
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
TypeShapeVisitorThe visitor to accept.
state
objectThe state parameter to pass to the underlying visitor.