Table of Contents

Struct PreconditionResult

Namespace
Signal.Application.Commands.Preconditions
Assembly
Signal.Application.dll

Outcome of a precondition check.

public readonly record struct PreconditionResult : IEquatable<PreconditionResult>
Implements
Inherited Members

Constructors

PreconditionResult(bool, string?)

Outcome of a precondition check.

public PreconditionResult(bool IsSuccess, string? Reason)

Parameters

IsSuccess bool

Whether the command may run.

Reason string

A user-facing reason on failure; null fails silently.

Properties

IsSuccess

Whether the command may run.

public bool IsSuccess { get; init; }

Property Value

bool

Reason

A user-facing reason on failure; null fails silently.

public string? Reason { get; init; }

Property Value

string

Success

The check passed.

public static PreconditionResult Success { get; }

Property Value

PreconditionResult

Methods

Fail(string?)

The check failed.

public static PreconditionResult Fail(string? reason)

Parameters

reason string

A user-facing reason, or null to fail silently.

Returns

PreconditionResult

The result.