示例#1
0
 public static Result <R> Map <T, R>(this Result <T> source, Func <T, R> map)
 {
     return(source.Match(x => Success.Of(map(x)), Error.Of <R>));
 }
示例#2
0
 public static Result <T> Of <T>(T success, Exception error)
 {
     return(error == null?Success.Of(success) : Error.Of <T>(error));
 }