ResultExtensionsIntoResT(Opt`1T, String) Method
Shorthand for mapping options to results as follows:
- None<T> => Err<T> with the given error message;
- Some(T) => Ok(T).
Namespace: Orx.Fun.ResultAssembly: Orx.Fun.Result (in Orx.Fun.Result.dll) Version: 1.3.0+344c8bdd6f720ccfb2d8db7c61b76cf02be18f5f
public static Res<T> IntoRes<T>(
this Opt<T> option,
string errorMessageIfNone
)
- option OptT
- Option to be converted to result.
- errorMessageIfNone String
- Error message to be stored in the Err to be returned if the option is None.
- T
- Type of the underlying value.
ResTIn Visual Basic and C#, you can call this method as an instance method on any object of type
OptT. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).