Table of Contents

Class AssociatedTypeShapeAttribute

Namespace
PolyType
Assembly
PolyType.dll

Identifies one or more associated types for which shapes should be generated when the type this attribute is applied to has a shape generated for it.

[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Interface, AllowMultiple = true, Inherited = false)]
public class AssociatedTypeShapeAttribute : Attribute
Inheritance
AssociatedTypeShapeAttribute
Inherited Members

Remarks

If the type this attribute is applied to is a generic type definition, each type in this array must also be a generic type definition with the same number of generic type parameters.

Constructors

AssociatedTypeShapeAttribute(params Type[])

Identifies one or more associated types for which shapes should be generated when the type this attribute is applied to has a shape generated for it.

public AssociatedTypeShapeAttribute(params Type[] associatedTypes)

Parameters

associatedTypes Type[]

The types whose shapes should be generated.

Remarks

If the type this attribute is applied to is a generic type definition, each type in this array must also be a generic type definition with the same number of generic type parameters.

Properties

AssociatedTypes

Gets the types whose shapes should be generated.

public Type[] AssociatedTypes { get; }

Property Value

Type[]

Requirements

Gets the elements of the generated shape that are required at runtime.

public TypeShapeRequirements Requirements { get; init; }

Property Value

TypeShapeRequirements

The default value is Full.

Remarks

This property only impacts generation of object shapes. All other shapes (e.g. collections, enums, unions) are always completely defined.