Table of Contents

Class TypeShapeExtensionAttribute

Namespace
PolyType
Assembly
PolyType.dll

An assembly-level attribute that can extend an existing type's generated shape, as if TypeShapeAttribute had been applied to the target type.

[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
public class TypeShapeExtensionAttribute : Attribute
Inheritance
TypeShapeExtensionAttribute
Inherited Members

Constructors

TypeShapeExtensionAttribute(Type)

Initializes a new instance of the TypeShapeExtensionAttribute class.

public TypeShapeExtensionAttribute(Type target)

Parameters

target Type

The type to be extended.

Properties

AssociatedTypes

Types for which a factory should be generated when a type shape is generated for Target.

public Type[] AssociatedTypes { get; init; }

Property Value

Type[]

Remarks

Each type must declare a public default constructor.

If Target 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.

Target

Gets the target type.

public Type Target { get; }

Property Value

Type

Remarks

This is the type that is being extended. If the type is declared in the same assembly that contains this attribute, consider removing this attribute in favor of applying TypeShapeAttribute directly to the target type.