Table of Contents

Class DiscardExtensions

Namespace
Trellis
Assembly
Trellis.Results.dll

Provides extension methods for explicitly discarding a Result value. Use when the outcome is intentionally ignored (e.g., best-effort operations). This is the idiomatic alternative to _ = result; and suppresses TRLS001 without requiring pragma directives.

public static class DiscardExtensions
Inheritance
DiscardExtensions
Inherited Members

Methods

Discard<T>(Result<T>)

Explicitly discards the result, indicating the caller intentionally ignores the outcome.

public static void Discard<T>(this Result<T> result)

Parameters

result Result<T>

The result to discard.

Type Parameters

T

Type of the result value.