Warning:
Fauna is decommissioning FQL v4 on June 30, 2025.
This driver is not compatible with FQL v10, the latest version. Fauna accounts created after August 21, 2024 must use FQL v10.
Ensure you migrate existing projects to the official v10 driver by the v4 EOL date: https://github.com/fauna/fauna-dotnet.
For more information, see the v4 end of life (EOL) announcement and related FAQ.
Represents an optional value. More...
Inherited by FaunaDB.Types.None< T >, and FaunaDB.Types.Some< T >.
Public Member Functions | |
IOption< U > | Map< U > (Func< T, U > func) |
Apply the function passed on the optional value. More... | |
IOption< U > | FlatMap< U > (Func< T, IOption< U >> func) |
Apply the function passed on the optional value. More... | |
U | Match< U > (Func< T, U > Some, Func< U > None) |
Matches the current instance. Case it contains some value it will execute the first argument. Case it contains none value it will execute the second argument. More... | |
void | Match (Action< T > Some, Action None) |
Matches the current instance. Case it contains some value it will execute the first argument. Case it contains none value it will execute the second argument. More... | |
Properties | |
T | Value [get] |
IOption<U> FaunaDB.Types.IOption< T >.FlatMap< U > | ( | Func< T, IOption< U >> | func | ) |
Apply the function passed on the optional value.
func | the map function to be applied |
IOption<U> FaunaDB.Types.IOption< T >.Map< U > | ( | Func< T, U > | func | ) |
Apply the function passed on the optional value.
func | the map function to be applied |
void FaunaDB.Types.IOption< T >.Match | ( | Action< T > | Some, |
Action | None | ||
) |
Matches the current instance. Case it contains some value it will execute the first argument. Case it contains none value it will execute the second argument.
IOption<string> optional = ...
result.Match( Some: value => DoSomething(value), None: () => DoSomethingElse() );
Some | Function to be executed case this instance contains some value |
None | Function to be executed case this instance contains none value |
U FaunaDB.Types.IOption< T >.Match< U > | ( | Func< T, U > | Some, |
Func< U > | None | ||
) |
Matches the current instance. Case it contains some value it will execute the first argument. Case it contains none value it will execute the second argument.
IOption<string> optional = ...
int parsed = result.Match( Some: value => int.Parse(value), None: () => ReturnDefaultValue() );
Some | Function to be executed case this instance contains some value |
None | Function to be executed case this instance contains none value |
|
get |