You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the @PolyType.ITypeShape.GetAssociatedTypeShape*?displayProperty=nameWithType method to obtain the shape of an associated type.
176
-
The @PolyType.SourceGenModel.SourceGenTypeShapeProvider implementation of this method requires that the associated types be pre-determined at compile time via attributes.
177
-
The @PolyType.ReflectionProvider.ReflectionTypeShapeProvider is guaranteed to work with all types and therefore does _not_ require these attributes.
175
+
Use the <xref:PolyType.ITypeShape.GetAssociatedTypeShape*> method to obtain the shape of an associated type.
176
+
The <xref:PolyType.SourceGenModel.SourceGenTypeShapeProvider> implementation of this method requires that the associated types be pre-determined at compile time via attributes.
177
+
The <xref:PolyType.ReflectionProvider.ReflectionTypeShapeProvider> is guaranteed to work with all types and therefore does _not_ require these attributes.
178
178
Thus, it can be valuable to test your associated types code with the source generation provider to ensure your code is AOT-compatible.
179
179
180
180
An associated type must have at least `internal` visibility for its shape to be generated for use within its same assembly.
@@ -190,20 +190,20 @@ This can be appropriate for a serializer that needs to jump from a generic data
Only @PolyType.SourceGenModel.SourceGenTypeShapeProvider produces partial shapes.
194
-
The @PolyType.ReflectionProvider.ReflectionTypeShapeProvider always produces complete shapes.
193
+
Only <xref:PolyType.SourceGenModel.SourceGenTypeShapeProvider> produces partial shapes.
194
+
The <xref:PolyType.ReflectionProvider.ReflectionTypeShapeProvider> always produces complete shapes.
195
195
196
-
At present, only @PolyType.Abstractions.IObjectTypeShape shapes are generated partially.
196
+
At present, only <xref:PolyType.Abstractions.IObjectTypeShape> shapes are generated partially.
197
197
Shapes for collections, enums, unions, etc. are generated as full shapes.
198
198
199
-
Type associations can be defined directly on the originating type via @PolyType.AssociatedTypeShapeAttribute.AssociatedTypes?displayProperty=nameWithType when that type and its associated type are in the same assembly.
200
-
When the associated type is in another assembly, use @PolyType.TypeShapeExtensionAttribute.AssociatedTypes?displayProperty=nameWithType in the assembly that declares the associated type.
199
+
Type associations can be defined directly on the originating type via <xref:PolyType.AssociatedTypeShapeAttribute.AssociatedTypes> when that type and its associated type are in the same assembly.
200
+
When the associated type is in another assembly, use <xref:PolyType.TypeShapeExtensionAttribute.AssociatedTypes> in the assembly that declares the associated type.
201
201
You can also define a custom attribute that can define associated types by attributing your own custom attribute with @PolyType.Abstractions.AssociatedTypeAttributeAttribute.
202
202
203
203
### TypeShapeExtensionAttribute
204
204
205
-
The @PolyType.TypeShapeExtensionAttribute is an assembly-level attribute.
206
-
It is very similar to @PolyType.TypeShapeAttribute, but it is used to customize the generated shape for a type that your assembly does not declare.
205
+
The <xref:PolyType.TypeShapeExtensionAttribute> is an assembly-level attribute.
206
+
It is very similar to <xref:PolyType.TypeShapeAttribute>, but it is used to customize the generated shape for a type that your assembly does not declare.
0 commit comments