Struct OptionalPathParam<T>
Represents an optional path parameter that may or may not have a value. Use this as the view model parameter in view models and route groups when some aliases of the route don't supply the value in the path.
Namespace: Singulink.UI.Navigation
Assembly: Singulink.UI.Navigation.dll
Syntax
public readonly struct OptionalPathParam<T> : ISingleRouteParam<OptionalPathParam<T>>, IEquatable<OptionalPathParam<T>> where T : notnull, IParsable<T>, IEquatable<T>
Type Parameters
| Name | Description |
|---|---|
| T | The type of the parameter value. |
Constructors
| Name | Description |
|---|---|
| OptionalPathParam(T?) | Initializes a new instance of the OptionalPathParam<T> struct with the specified value. |
Properties
| Name | Description |
|---|---|
| HasValue | Gets a value indicating whether this instance has a value. |
| None | Gets an OptionalPathParam<T> instance with no value. |
| Value | Gets the parameter value. |
Methods
| Name | Description |
|---|---|
| Equals(OptionalPathParam<T>) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
| GetValueOrDefault(T) | Gets the parameter value if this instance has a value, or the specified default value if this instance has no value. |
| ToString() | Returns the formatted string representation of the value, or null if this instance has no value. |
| TryParse(string, out OptionalPathParam<T>) | Attempts to parse the specified string into an instance of OptionalPathParam<T> using invariant culture formatting. |
Operators
| Name | Description |
|---|---|
| operator ==(OptionalPathParam<T>, OptionalPathParam<T>) | Determines whether two OptionalPathParam<T> instances are equal. |
| implicit operator OptionalPathParam<T>(T?) | Converts a value to an OptionalPathParam<T>. |
| operator !=(OptionalPathParam<T>, OptionalPathParam<T>) | Determines whether two OptionalPathParam<T> instances are not equal. |