Represents the common interface for all option monads.
Namespace: DotNext Assembly: DotNext.dll Syntaxpublic interface IOptionMonad<T> : ISupplier<object?>, IFunctional<Func<object?>>
Type Parameters Name Description T
The type of the value in the container.
Properties | Edit this page View Source HasValueIndicates that this monad contains a value.
Declaration Property Value | Edit this page View Source ValueOrDefaultIf a value is present, returns the value, otherwise return default value.
DeclarationT? ValueOrDefault { get; }
Property Value Type Description T
The value stored in the container, if present, otherwise, default value.
Methods | Edit this page View Source Or(T?)Returns the value if present; otherwise return default value.
Declaration Parameters Type Name Description T defaultValueThe value to be returned if there is no value present.
Returns Type Description TThe value, if present, otherwise defaultValue
.
Returns the value if present; otherwise invoke delegate.
DeclarationT OrInvoke(Func<T> defaultFunc)
Parameters Type Name Description Func<T> defaultFunc
A delegate to be invoked if value is not present.
Returns Type Description TThe value, if present, otherwise returned from delegate.
| Edit this page View Source TryGet(out T)Attempts to extract value from the container if it is present.
Declaration Parameters Type Name Description T valueExtracted value.
Returns Type Description booltrue if value is present; otherwise, false.
Extension MethodsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4