Skip to main content
Version: Preview (0.3.0-preview.205)

Class ValueObjectPattern

Namespace: AdCodicem.ValueObjects
Assembly: AdCodicem.ValueObjects.Abstractions.dll

A generic bridge to the pattern a value object declares through , used by generated code and by the registry.

public static class ValueObjectPattern

Inheritance​

object ← ValueObjectPattern

Inherited Members​

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Remarks​

A static abstract member is reached through a type parameter, which finds it however the value object implements it. Named on the type, Iban.Pattern would miss an explicit implementation and fail to compile in a file the consumer cannot edit. The JIT specializes the call for the struct, so the indirection costs nothing.

Methods​

Of<TSelf>()​

Gets the regular expression a value object declares.

public static Regex Of<TSelf>() where TSelf : IValueObjectPatternValidator

Returns​

Regex

Its pattern.

Type Parameters​

TSelf

The value object.