Class EntityIdDescriptor
Namespace: AdCodicem.ValueObjects.Identifiers
Assembly: AdCodicem.ValueObjects.Identifiers.dll
Runtime description of one entity identifier type, reachable from its prefix alone.
public sealed class EntityIdDescriptor
Inheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
The delegate it carries operates on boxed values, which is acceptable for the same reason it is on
Properties
Granularity
Gets the width of the time bucket heading the body.
public IdGranularity Granularity { get; }
Property Value
Length
Gets the exact length of an identifier of this type, which is also the width of its database column.
public int Length { get; }
Property Value
Prefix
Gets the prefix the type claims, without its trailing separator.
public string Prefix { get; }
Property Value
TryParse
Gets the non-throwing text parser, producing a boxed identifier.
public BoxedTryParse TryParse { get; }
Property Value
ValueObjectType
Gets the identifier type.
public Type ValueObjectType { get; }
Property Value
Methods
Accept<TResult>(IEntityIdVisitor<TResult>)
Hands the identifier type to a visitor, closed at compile time where the descriptor was built.
public TResult Accept<TResult>(IEntityIdVisitor<TResult> visitor)
Parameters
visitor IEntityIdVisitor<TResult>
The visitor.
Returns
TResult
What the visitor built for the identifier type.
Type Parameters
TResult
What the visitor builds.
Remarks
Every descriptor is built by
Exceptions
visitor is null.
For<TSelf>()
Builds a descriptor, resolving every operation statically.
public static EntityIdDescriptor For<TSelf>() where TSelf : struct, IEntityId<TSelf>
Returns
The descriptor.
Type Parameters
TSelf
Identifier type.