Class CommandRefusal
- Namespace
- Cratis.Arc.Commands
- Assembly
- Cratis.Arc.Core.dll
Describes why a command was refused without treating retryable or infrastructure failures as refusals.
public record CommandRefusal : IEquatable<CommandRefusal>
- Inheritance
-
CommandRefusal
- Implements
- Inherited Members
- Extension Methods
Constructors
CommandRefusal(CommandRefusal)
protected CommandRefusal(CommandRefusal original)
Parameters
originalCommandRefusal
CommandRefusal(CommandRefusalKind, string?, string)
Describes why a command was refused without treating retryable or infrastructure failures as refusals.
public CommandRefusal(CommandRefusalKind Kind, string? ConstraintName, string Message)
Parameters
KindCommandRefusalKindThe refusal category.
ConstraintNamestringThe violated constraint name, when available for a constraint refusal.
MessagestringThe authored refusal messages, verbatim and joined with a newline.
Properties
ConstraintName
Gets the first violated constraint name, or null when no names are available.
public string? ConstraintName { get; }
Property Value
ConstraintNames
Gets all violated constraint names in result order, without duplicates.
public IReadOnlyList<string> ConstraintNames { get; init; }
Property Value
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
Kind
The refusal category.
public CommandRefusalKind Kind { get; init; }
Property Value
Message
The authored refusal messages, verbatim and joined with a newline.
public string Message { get; init; }
Property Value
Methods
Deconstruct(out CommandRefusalKind, out string?, out string)
public void Deconstruct(out CommandRefusalKind Kind, out string? ConstraintName, out string Message)
Parameters
KindCommandRefusalKindConstraintNamestringMessagestring
Equals(CommandRefusal?)
Compares refusals by their kind, authored message and ordered constraint names.
public virtual bool Equals(CommandRefusal? other)
Parameters
otherCommandRefusalThe refusal to compare.
Returns
- bool
Whether both refusals describe the same outcome.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToString()
public override string ToString()
Returns
Operators
operator ==(CommandRefusal?, CommandRefusal?)
public static bool operator ==(CommandRefusal? left, CommandRefusal? right)
Parameters
leftCommandRefusalrightCommandRefusal
Returns
operator !=(CommandRefusal?, CommandRefusal?)
public static bool operator !=(CommandRefusal? left, CommandRefusal? right)
Parameters
leftCommandRefusalrightCommandRefusal