Table of Contents

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

bool

HasReasons

Gets a value indicating whether the result contains reason data.

public bool HasReasons { get; }

Property Value

bool

IsDenied

Gets a value indicating whether this result denies the operation.

public bool IsDenied { get; }

Property Value

bool

IsNotApplicable

Gets a value indicating whether this result is not applicable to the supplied context.

public bool IsNotApplicable { get; }

Property Value

bool

IsWarning

Gets a value indicating whether this result contains warnings.

public bool IsWarning { get; }

Property Value

bool

Outcome

Gets the constraint evaluation outcome.

public ConstraintEvaluationOutcome Outcome { get; }

Property Value

ConstraintEvaluationOutcome

ReasonCodes

Gets machine-readable reason codes associated with denied or warning outcomes.

public IReadOnlyList<string> ReasonCodes { get; }

Property Value

IReadOnlyList<string>

Reasons

Gets reasons associated with denied or warning outcomes.

public IReadOnlyList<OperationReason> Reasons { get; }

Property Value

IReadOnlyList<OperationReason>

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

reason OperationReason

The 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

reasons IEnumerable<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

code string

The machine-readable reason code.

message string

The human-readable reason message.

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

reason OperationReason

The 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

reasons IEnumerable<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

code string

The machine-readable reason code.

message string

The human-readable reason message.

Returns

ConstraintEvaluationResult

A warning constraint evaluation result.