Table of Contents

Class CommandResult<T>

Namespace
Opossum.Core
Assembly
Opossum.dll

Represents the result of a command operation with a return value

public record CommandResult<T> : IEquatable<CommandResult<T>>

Type Parameters

T

The type of the return value

Inheritance
CommandResult<T>
Implements
Inherited Members

Constructors

CommandResult(bool, T?, string?)

Represents the result of a command operation with a return value

public CommandResult(bool Success, T? Value = default, string? ErrorMessage = null)

Parameters

Success bool
Value T
ErrorMessage string

Properties

ErrorMessage

public string? ErrorMessage { get; init; }

Property Value

string

Success

public bool Success { get; init; }

Property Value

bool

Value

public T? Value { get; init; }

Property Value

T

Methods

Fail(string)

Creates a failed command result with an error message

public static CommandResult<T> Fail(string errorMessage)

Parameters

errorMessage string

Returns

CommandResult<T>

Ok(T)

Creates a successful command result with a value

public static CommandResult<T> Ok(T value)

Parameters

value T

Returns

CommandResult<T>