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
resultResult<T>The result to discard.
Type Parameters
TType of the result value.