Class ConstraintEvaluationResult
- Namespace
- AsiBackbone.Core.Constraints
- Assembly
- AsiBackbone.Core.dll
Represents the framework-neutral result of evaluating a constraint.
public sealed class ConstraintEvaluationResult
- Inheritance
-
ConstraintEvaluationResult
- Inherited Members
Properties
CanProceed
Gets a value indicating whether the constraint allows the operation to proceed.
public bool CanProceed { get; }
Property Value
HasReasons
Gets a value indicating whether the result contains reason data.
public bool HasReasons { get; }
Property Value
IsDenied
Gets a value indicating whether this result denies the operation.
public bool IsDenied { get; }
Property Value
IsNotApplicable
Gets a value indicating whether this result is not applicable to the supplied context.
public bool IsNotApplicable { get; }
Property Value
IsWarning
Gets a value indicating whether this result contains warnings.
public bool IsWarning { get; }
Property Value
Outcome
Gets the constraint evaluation outcome.
public ConstraintEvaluationOutcome Outcome { get; }
Property Value
ReasonCodes
Gets machine-readable reason codes associated with denied or warning outcomes.
public IReadOnlyList<string> ReasonCodes { get; }
Property Value
Reasons
Gets reasons associated with denied or warning outcomes.
public IReadOnlyList<OperationReason> Reasons { get; }
Property Value
Methods
Allow()
Creates an allowed constraint result.
public static ConstraintEvaluationResult Allow()
Returns
- ConstraintEvaluationResult
An allowed constraint evaluation result.
Deny(OperationReason)
Creates a denied constraint result.
public static ConstraintEvaluationResult Deny(OperationReason reason)
Parameters
reasonOperationReasonThe reason associated with the denied result.
Returns
- ConstraintEvaluationResult
A denied constraint evaluation result.
Deny(IEnumerable<OperationReason>)
Creates a denied constraint result.
public static ConstraintEvaluationResult Deny(IEnumerable<OperationReason> reasons)
Parameters
reasonsIEnumerable<OperationReason>The reasons associated with the denied result.
Returns
- ConstraintEvaluationResult
A denied constraint evaluation result.
Deny(string, string)
Creates a denied constraint result.
public static ConstraintEvaluationResult Deny(string code, string message)
Parameters
Returns
- ConstraintEvaluationResult
A denied constraint evaluation result.
NotApplicable()
Creates a not-applicable constraint result.
public static ConstraintEvaluationResult NotApplicable()
Returns
- ConstraintEvaluationResult
A not-applicable constraint evaluation result.
Warning(OperationReason)
Creates a warning constraint result.
public static ConstraintEvaluationResult Warning(OperationReason reason)
Parameters
reasonOperationReasonThe reason associated with the warning result.
Returns
- ConstraintEvaluationResult
A warning constraint evaluation result.
Warning(IEnumerable<OperationReason>)
Creates a warning constraint result.
public static ConstraintEvaluationResult Warning(IEnumerable<OperationReason> reasons)
Parameters
reasonsIEnumerable<OperationReason>The reasons associated with the warning result.
Returns
- ConstraintEvaluationResult
A warning constraint evaluation result.
Warning(string, string)
Creates a warning constraint result.
public static ConstraintEvaluationResult Warning(string code, string message)
Parameters
Returns
- ConstraintEvaluationResult
A warning constraint evaluation result.