Example #1
0
 private Result(TReturn returnValue, Type returnType)
 {
     ReturnValue = returnValue;
     if (ReturnValue == null)
     {
         _failureInfo = new ResultFailure(returnType);
     }
     IsSuccess = (ReturnValue != null);
 }
Example #2
0
 public void AddFailure(int code, string message = null)
 {
     IsSuccess = false;
     if (_failureInfo == null)
     {
         _failureInfo = new ResultFailure(typeof(TReturn), code, message);
     }
     else
     {
         _failureInfo.Errors.Add(new ResultFailure.Error(code, message));
     }
 }
Example #3
0
 private Result()
 {
     ReturnValue  = default(TReturn);
     _failureInfo = new ResultFailure(typeof(TReturn));
     IsSuccess    = false;
 }
Example #4
0
 private Result(ResultFailure failureInfo, object instance)
 {
     _failureInfo        = failureInfo;
     _failureInfo.Object = instance;
     IsSuccess           = false;
 }
Example #5
0
 private Result(ResultFailure failureInfo)
 {
     _failureInfo = failureInfo;
     IsSuccess    = false;
 }
Example #6
0
 public static Result <TReturn> Failed(ResultFailure failureInfo, object instance)
 {
     return(new Result <TReturn>(failureInfo, instance));
 }
Example #7
0
 public static Result <TReturn> Failed(ResultFailure failureInfo)
 {
     return(new Result <TReturn>(failureInfo));
 }
 public ResultException(ResultFailure failureInfo)
 {
     FailureInfo = failureInfo;
 }