public static TResult Match <T, TResult>(this Bridge3145_Optional <Bridge3145_ResultOrError <T> > source, Func <TResult> handleNoValue, Func <T, TResult> handleResult, Func <string, TResult> handleError) { if (!source.IsDefined) { return(handleNoValue()); } return(source.Value.Match(handleResult, handleError)); }
private Bridge3145_ResultOrError(Bridge3145_Optional <T> result, Bridge3145_Optional <string> errorMessage) { _result = result; _errorMessage = errorMessage; }