Class PrimitiveAttribute
This is an abstract class for custom attributes that can be applied to struct types. It provides a flag to control whether to generate a method that implements the IValidatableObject interface.
Inheritance
object
Attribute
PrimitiveAttribute
Namespace: Primitively
Assembly: Primitively.Abstractions.dll
Syntax
[AttributeUsage(AttributeTargets.Struct, Inherited = true, AllowMultiple = false)]
public abstract class PrimitiveAttribute : Attribute
Properties
ImplementIValidatableObject
Gets or sets a flag to indicate whether to source generate a Validate(ValidationContext) method.
Declaration
public bool ImplementIValidatableObject { get; set; }
Property Value
Type | Description |
---|---|
bool | When set to true, it will output a Primitively type that implements the IValidatableObject interface. |
Remarks
For more information about validation: https://learn.microsoft.com/en-us/aspnet/core/mvc/models/validation?view=aspnetcore-8.0#ivalidatableobject