public static MaybeNotNull <T> Catch <T, TException>(this MaybeNotNull <T> source, Func <TException, T> getValue) where TException : Exception { //Contract.Requires( source != null ); //Contract.Ensures( //Contract.Result<MaybeNotNull<T>>() != null ); return(source.Catch((TException ex) => Maybe.Value(getValue(ex)))); }
public static MaybeNotNull <T> Catch <T>(this MaybeNotNull <T> source, T defaultValue) { //Contract.Requires( source != null ); //Contract.Ensures( //Contract.Result<MaybeNotNull<T>>() != null ); return(source.Catch(Maybe.Value(defaultValue))); }