Struct Optional<T>
A value that may be left out, as opposed to given as null.
Implements
IEquatable<Optional<T>>
Inherited Members
Namespace: Uniform.Matrix.Server.Accounts
Assembly: Uniform.Matrix.Server.dll
Syntax
public readonly record struct Optional<T> : IEquatable<Optional<T>>
Type Parameters
| Name | Description |
|---|---|
| T | Type of the value. |
Constructors
| Edit this page View SourceOptional(bool, T)
A value that may be left out, as opposed to given as null.
Declaration
public Optional(bool IsSet, T Value)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | IsSet | Whether the value was given. |
| T | Value | The value, when given. |
Properties
| Edit this page View SourceIsSet
Whether the value was given.
Declaration
public bool IsSet { get; init; }
Property Value
| Type | Description |
|---|---|
| bool |
Value
The value, when given.
Declaration
public T Value { get; init; }
Property Value
| Type | Description |
|---|---|
| T |
Methods
| Edit this page View SourceOf(T)
A given value.
Declaration
public static Optional<T> Of(T value)
Parameters
| Type | Name | Description |
|---|---|---|
| T | value |
Returns
| Type | Description |
|---|---|
| Optional<T> |