Class GenerateShapeForAttribute
- Namespace
- PolyType
- Assembly
- PolyType.dll
Instructs the PolyType source generator to include type
in the ITypeShapeProvider that it generates.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct, AllowMultiple = true, Inherited = false)]
[Conditional("NEVER")]
public sealed class GenerateShapeForAttribute : Attribute
- Inheritance
-
GenerateShapeForAttribute
- Inherited Members
Remarks
The source generator will include a static property in the annotated class pointing to the ITypeShapeProvider that was generated for the entire project.
For projects targeting .NET 8 or later, this additionally augments the class
with an implementation of IShapeable for type
.
Constructors
GenerateShapeForAttribute(Type)
Instructs the PolyType source generator to include type
in the ITypeShapeProvider that it generates.
public GenerateShapeForAttribute(Type type)
Parameters
type
TypeThe type for which shape metadata will be generated. This must not be an open-generic type.
Remarks
The source generator will include a static property in the annotated class pointing to the ITypeShapeProvider that was generated for the entire project.
For projects targeting .NET 8 or later, this additionally augments the class
with an implementation of IShapeable for type
.
- See Also