예제 #1
0
 /// <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));
 }
예제 #2
0
 /// <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));
 }
예제 #3
0
 /// <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));
 }
예제 #4
0
 /// <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));
 }
예제 #5
0
 /// <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());
 }