Class ValueObjectCheckOptions
Namespace: AdCodicem.ValueObjects.EntityFrameworkCore
Assembly: AdCodicem.ValueObjects.EntityFrameworkCore.dll
Chooses the rules
public sealed class ValueObjectCheckOptions
Inheritance
object ← ValueObjectCheckOptions
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Properties
Patterns
Gets or sets the dialect of regular expressions the database runs, which a pattern is written in: none by default, so that no pattern is written.
public ValueObjectPatternDialect Patterns { get; set; }
Property Value
Remarks
The model cannot tell which dialect the database runs, the compatibility level of a SQL Server database least of all, so it is stated. A dialect that does not match the provider at hand, PostgreSQL's under SQLite in tests, writes no pattern; SQLite has no regular expressions.
Naming one checks the pattern of each column the convention constrains when the model is built, under SQLite, or
the provider of the other dialect, as under the database it names: a pattern holding a construct the dialect reads
apart from .NET, or whose regular expression sets any option but CultureInvariant, Compiled,
ExplicitCapture and NonBacktracking, which its text does not carry, IgnoreCase say, or
ECMAScript and RightToLeft, which VO0025 does not report, fails the model with an
Rules
Gets or sets the rules written as CHECK constraints: lengths, bounds and closed value sets, unless one is removed.
public ValueObjectChecks Rules { get; set; }
Property Value
Methods
ExcludePattern<TSelf>()
Leaves the pattern of a value object out of the constraints, and out of the check of
public ValueObjectCheckOptions ExcludePattern<TSelf>() where TSelf : struct, IValueObject<TSelf, string>
Returns
The same options, so calls can be chained.
Type Parameters
TSelf
The value object, over
Remarks
For a value object whose pattern the dialect would read apart from .NET, an email address's [^@\s] say, which
would otherwise fail the model: the database then checks its length, as before, and the application its pattern.