Table of Contents

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

AcknowledgmentChallenge

CanExecute

Gets a value indicating whether the ASP.NET Core endpoint may continue execution.

public bool CanExecute { get; }

Property Value

bool

Decision

Gets the governance decision associated with the endpoint evaluation, when one was produced.

public GovernanceDecision? Decision { get; }

Property Value

GovernanceDecision

FailureResult

Gets the HTTP result that should be returned instead of executing the endpoint, when execution is blocked.

public IResult? FailureResult { get; }

Property Value

IResult

Methods

Allow(GovernanceDecision?)

Creates a result that allows endpoint execution to continue.

public static EndpointGovernanceResult Allow(GovernanceDecision? decision = null)

Parameters

decision GovernanceDecision

The 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

failureResult IResult

The HTTP result to execute.

decision GovernanceDecision

The 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

decision GovernanceDecision

The 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

challenge AcknowledgmentChallenge

The acknowledgment challenge.

failureResult IResult

The HTTP result to execute.

decision GovernanceDecision

The governance decision that required acknowledgment.

Returns

EndpointGovernanceResult

An acknowledgment challenge result.