Beispiel #1
0
 /// <summary>
 /// Creates a successful or a failed attempt, with a result.
 /// </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="condition">A value indicating whether the attempt is successful.</param>
 /// <param name="succStatus">The status of the successful attempt.</param>
 /// <param name="failStatus">The status of the failed attempt.</param>
 /// <param name="result">The result of the attempt.</param>
 /// <returns>The attempt.</returns>
 public static Attempt <TResult, TStatus> IfWithStatus <TResult, TStatus>(bool condition, TStatus succStatus, TStatus failStatus, TResult result)
 {
     return(Attempt <TResult, TStatus> .If(condition, succStatus, failStatus, result));
 }
Beispiel #2
0
 /// <summary>
 /// Creates a successful or a failed attempt, with a result.
 /// </summary>
 /// <typeparam name="TResult">The type of the attempted operation result.</typeparam>
 /// <param name="condition">A value indicating whether the attempt is successful.</param>
 /// <param name="result">The result of the attempt.</param>
 /// <returns>The attempt.</returns>
 public static Attempt <TResult> If <TResult>(bool condition, TResult result)
 {
     return(Attempt <TResult> .If(condition, result));
 }