Table of Contents

Class Result<T>

Namespace
MoonBark.GridPlacement.Core.Interfaces
Assembly
MoonBark.GridPlacement.Core.dll

Lightweight generic result type used by integration-facing interfaces such as IPlaceableInventoryAdapter and IPlaceablePersistenceAdapter.

public sealed class Result<T>

Type Parameters

T
Inheritance
Result<T>
Inherited Members

Properties

ErrorMessage

Optional error message for failed operations.

public string? ErrorMessage { get; }

Property Value

string

Success

True when the operation completed successfully.

public bool Success { get; }

Property Value

bool

Value

Value produced by a successful operation. May be null when the operation failed.

public T? Value { get; }

Property Value

T

Methods

CreateSuccess(T)

Creates a successful result wrapping the provided value.

public static Result<T> CreateSuccess(T value)

Parameters

value T

Returns

Result<T>

Failure(string)

Creates a failed result with an error message.

public static Result<T> Failure(string errorMessage)

Parameters

errorMessage string

Returns

Result<T>