Esempio n. 1
0
 /// <summary>
 /// Update the status if appropriate, and adds message to the failure causes
 /// </summary>
 public static PartialResult <T> Failure <T>(this PartialResult <T> src, string message)
 {
     src.AddState(PartialResultState.Failed);
     src.AddFailureCause(new StringException(message));
     return(src);
 }
Esempio n. 2
0
 /// <summary>
 /// Update the status if appropriate, and adds exception to the failure causes
 /// </summary>
 public static PartialResult <T> Failure <T>(this PartialResult <T> src, Exception cause)
 {
     src.AddState(PartialResultState.Failed);
     src.AddFailureCause(cause);
     return(src);
 }
Esempio n. 3
0
 /// <summary>
 /// Update the status if appropriate and set result data
 /// </summary>
 public static PartialResult <T> Success <T>(this PartialResult <T> src, T data)
 {
     src.AddState(PartialResultState.Success);
     src.ResultData = data;
     return(src);
 }