Interface IFailureFactory<TSelf>
- Namespace
- Trellis
- Assembly
- Trellis.Results.dll
Enables construction of a failure result of the implementing type from an Error. Implemented by Result<TValue> to support generic pipeline behaviors that need to construct failure results without knowing the inner type parameter.
public interface IFailureFactory<TSelf> where TSelf : IFailureFactory<TSelf>
Type Parameters
TSelfThe concrete result type (self-type pattern).
Methods
CreateFailure(Error)
Creates a failure result wrapping the given error.
public static abstract TSelf CreateFailure(Error error)
Parameters
errorErrorThe error describing the failure.
Returns
- TSelf
A failure result of type
TSelf.