Class ValueObjectSchema
Namespace: AdCodicem.ValueObjects.Metadata
Assembly: AdCodicem.ValueObjects.Abstractions.dll
The declarative constraints of a value object, captured once at compile time.
public sealed record ValueObjectSchema : IEquatable<ValueObjectSchema>
Inheritance
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
The generator fills this from the ValueObjectAttribute so that the rules enforced by
Validate and the rules published in the OpenAPI schema or applied to an EF Core column can never
drift apart: they all read the same instance.
Properties
Description
Gets the human-readable description of the value object, if any.
public string? Description { get; init; }
Property Value
Example
Gets an example value, if any.
public string? Example { get; init; }
Property Value
Format
Gets the OpenAPI format keyword for the value, if any.
public string? Format { get; init; }
Property Value
IsClosedValueSet
Gets a value indicating whether only
public bool IsClosedValueSet { get; init; }
Property Value
KnownValues
Gets the declared known underlying values, boxed, in declaration order.
public ImmutableArray<object> KnownValues { get; init; }
Property Value
Remarks
Surfaced as the enum keyword of the OpenAPI schema.
MaxLength
Gets the maximum accepted length, if any.
public int? MaxLength { get; init; }
Property Value
int?
Remarks
Used by the EF Core integration to size the mapped column.
Maximum
Gets the inclusive upper bound in invariant culture, if any.
public string? Maximum { get; init; }
Property Value
MinLength
Gets the minimum accepted length, if any.
public int? MinLength { get; init; }
Property Value
int?
Minimum
Gets the inclusive lower bound in invariant culture, if any.
public string? Minimum { get; init; }
Property Value
Pattern
Gets the regular expression the value must match, if any.
public string? Pattern { get; init; }
Property Value
Unconstrained
Gets the schema of a value object that declares no constraint.
public static ValueObjectSchema Unconstrained { get; }