/// <summary> /// Creates a failed attempt with a result, an exception and a status. /// </summary> /// <typeparam name="TResult">The type of the attempted operation result.</typeparam> /// <typeparam name="TStatus">The type of the attempted operation status.</typeparam> /// <param name="status">The status of the attempt.</param> /// <param name="result">The result of the attempt.</param> /// <param name="exception">The exception causing the failure of the attempt.</param> /// <returns>The failed attempt.</returns> public static Attempt <TResult, TStatus> FailWithStatus <TResult, TStatus>(TStatus status, TResult result, Exception exception) { return(Attempt <TResult, TStatus> .Fail(status, result, exception)); }
/// <summary> /// Creates a failed attempt with a result and an exception. /// </summary> /// <typeparam name="TResult">The type of the attempted operation result.</typeparam> /// <param name="result">The result of the attempt.</param> /// <param name="exception">The exception causing the failure of the attempt.</param> /// <returns>The failed attempt.</returns> public static Attempt <TResult?> Fail <TResult>(TResult result, Exception exception) { return(Attempt <TResult> .Fail(result, exception)); }
/// <summary> /// Creates a failed attempt with a result. /// </summary> /// <typeparam name="TResult">The type of the attempted operation result.</typeparam> /// <param name="result">The result of the attempt.</param> /// <returns>The failed attempt.</returns> public static Attempt <TResult?> Fail <TResult>(TResult result) { return(Attempt <TResult?> .Fail(result)); }
/// <summary> /// Creates a failed attempt with a result and a status. /// </summary> /// <typeparam name="TResult">The type of the attempted operation result.</typeparam> /// <typeparam name="TStatus">The type of the attempted operation status.</typeparam> /// <param name="status">The status of the attempt.</param> /// <param name="result">The result of the attempt.</param> /// <returns>The failed attempt.</returns> public static Attempt <TResult, TStatus> FailWithStatus <TResult, TStatus>(TStatus status, TResult result) { return(Attempt <TResult, TStatus> .Fail(status, result)); }
/// <summary> /// Creates a failed attempt. /// </summary> /// <typeparam name="TResult">The type of the attempted operation result.</typeparam> /// <returns>The failed attempt.</returns> public static Attempt <TResult> Fail <TResult>() { return(Attempt <TResult> .Fail()); }