Class CommandRefusalExtensions
- Namespace
- Cratis.Arc.Commands
- Assembly
- Cratis.Arc.Core.dll
Classifies command results into business refusals.
public static class CommandRefusalExtensions
- Inheritance
-
CommandRefusalExtensions
- Inherited Members
Methods
GetRefusal(CommandResult)
Classifies a failed command without acknowledging exceptions, concurrency or unknown failure reasons.
public static CommandRefusal? GetRefusal(this CommandResult result)
Parameters
resultCommandResultThe command result to classify.
Returns
- CommandRefusal
The refusal, or null for success or a non-refusal failure.
Remarks
Exceptions and error-severity validation reasons other than Rule or ConstraintViolation prevent classification, even in mixed results. Warning and information results never prevent classification. Otherwise authorization wins over constraints, which win over error-severity rules. All error constraint names and messages are retained in result order, with the first name also available as ConstraintName. Messages are joined with a newline. Validation joins all error rule messages in result order. Authorization retains its reason verbatim; configuration failures are not denials.