Class EndpointGovernanceResult
- Namespace
- AsiBackbone.AspNetCore.Endpoints
- Assembly
- AsiBackbone.AspNetCore.dll
Represents the outcome of ASP.NET Core endpoint governance evaluation before endpoint execution.
public sealed class EndpointGovernanceResult
- Inheritance
-
EndpointGovernanceResult
- Inherited Members
Properties
AcknowledgmentChallenge
Gets the acknowledgment challenge produced when a decision required acknowledgment.
public AcknowledgmentChallenge? AcknowledgmentChallenge { get; }
Property Value
CanExecute
Gets a value indicating whether the ASP.NET Core endpoint may continue execution.
public bool CanExecute { get; }
Property Value
Decision
Gets the governance decision associated with the endpoint evaluation, when one was produced.
public GovernanceDecision? Decision { get; }
Property Value
FailureResult
Gets the HTTP result that should be returned instead of executing the endpoint, when execution is blocked.
public IResult? FailureResult { get; }
Property Value
Methods
Allow(GovernanceDecision?)
Creates a result that allows endpoint execution to continue.
public static EndpointGovernanceResult Allow(GovernanceDecision? decision = null)
Parameters
decisionGovernanceDecisionThe governance decision that allowed execution.
Returns
- EndpointGovernanceResult
An allow result.
Block(IResult, GovernanceDecision?)
Creates a result that blocks endpoint execution and returns a host-safe failure result.
public static EndpointGovernanceResult Block(IResult failureResult, GovernanceDecision? decision = null)
Parameters
failureResultIResultThe HTTP result to execute.
decisionGovernanceDecisionThe governance decision that blocked execution.
Returns
- EndpointGovernanceResult
A blocked result.
BlockWithDefaultFailure(GovernanceDecision?)
Creates a result that blocks endpoint execution and lets middleware write the configured generic failure response.
public static EndpointGovernanceResult BlockWithDefaultFailure(GovernanceDecision? decision = null)
Parameters
decisionGovernanceDecisionThe governance decision that blocked execution.
Returns
- EndpointGovernanceResult
A blocked result without a custom failure response.
Challenge(AcknowledgmentChallenge, IResult, GovernanceDecision)
Creates a result that blocks execution with an acknowledgment challenge.
public static EndpointGovernanceResult Challenge(AcknowledgmentChallenge challenge, IResult failureResult, GovernanceDecision decision)
Parameters
challengeAcknowledgmentChallengeThe acknowledgment challenge.
failureResultIResultThe HTTP result to execute.
decisionGovernanceDecisionThe governance decision that required acknowledgment.
Returns
- EndpointGovernanceResult
An acknowledgment challenge result.