Class TypeShapeAttribute
- Namespace
- PolyType
- Assembly
- PolyType.dll
Configures the generated ITypeShape of the annotated type.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Struct|AttributeTargets.Enum|AttributeTargets.Interface, AllowMultiple = false, Inherited = false)]
public sealed class TypeShapeAttribute : Attribute
- Inheritance
-
TypeShapeAttribute
- Inherited Members
Properties
Kind
Gets the kind that should be generated for the annotated type.
public TypeShapeKind Kind { get; init; }
Property Value
Remarks
Passing None will result in the generation of an IObjectTypeShape that does not contain any properties or constructors.
Exceptions
- ArgumentOutOfRangeException
The specified value is not a valid TypeShapeKind.
Marshaller
Gets a type implementing an IMarshaller<T, TSurrogate> to a surrogate type.
public Type? Marshaller { get; init; }
Property Value
Remarks
The type should have a parameterless constructor and must implement IMarshaller<T, TSurrogate> where either of the two generic types should match the annotated type.
Types that specify a Marshaller will be of shape ISurrogateTypeShape.