Class KnownValueInfo
Namespace: AdCodicem.ValueObjects.Metadata
Assembly: AdCodicem.ValueObjects.Abstractions.dll
A value declared through [KnownValue]: the underlying value, the name of the static property the generator
creates for it, and the description the attribute gives it.
public sealed record KnownValueInfo : IEquatable<KnownValueInfo>
Inheritance
Implements
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
enum of a closed value set, so that a client generated from the
document names the members of its enumeration as the server code names its constants, France rather than
FR.
The name therefore becomes part of the contract a generated client holds: renaming a known value renames that member in every client generated afterwards, as renaming a member of an enumeration would.
Constructors
KnownValueInfo(object, string, string?)
Initializes a new instance of the
public KnownValueInfo(object value, string name, string? description = null)
Parameters
value object
The underlying value, as
name string
The name of the known value, the name of its static property on the value object.
description string?
Its description, if any.
Exceptions
value or name is null.
name is empty or consists only of white space.
Properties
Description
Gets the description of the known value, if one was declared.
public string? Description { get; }
Property Value
Name
Gets the name of the known value, the name of its static property on the value object.
public string Name { get; }
Property Value
Value
Gets the underlying value.
public object Value { get; }