Struct RouteQuery
Represents an immutable, insertion-ordered collection of query string parameters with strongly-typed access. Values are stored as strings and converted using the same invariant culture formatting used for route path parameters.
Namespace: Singulink.UI.Navigation
Assembly: Singulink.UI.Navigation.dll
Syntax
public readonly struct RouteQuery : IEquatable<RouteQuery>, IEnumerable<(string Key, string Value)>, IEnumerable
Remarks
Equality is key-order insensitive: two queries with the same key/value pairs compare equal and produce the same hash code regardless of the order in which their entries were added.
Constructors
| Name | Description |
|---|---|
| RouteQuery(params ReadOnlySpan<(string Name, string Value)>) | Initializes a new instance of the RouteQuery struct with the specified pre-formatted string parameters. If duplicate keys are provided, the last occurrence wins. Use RouteQueryBuilder to compose a query from strongly-typed values. |
Properties
| Name | Description |
|---|---|
| Count | Gets the number of query parameters. |
| Empty | Gets an empty query instance with no parameters. |
Methods
| Name | Description |
|---|---|
| ContainsKey(string) | Determines whether the query contains a parameter with the specified key. |
| Equals(RouteQuery) | 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. |
| GetEnumerator() | Gets an enumerator over the query parameter key-value pairs in insertion order. |
| GetHashCode() | Returns the hash code for this instance. |
| GetValue<T>(string) | Gets the value associated with the specified key, parsed as the specified type using invariant culture formatting. |
| ToBuilder() | Returns a new RouteQueryBuilder seeded with this query's entries. |
| ToString() | Returns a query string representation of the parameters (e.g. |
| TryGetValue<T>(string, bool, out T?) | Attempts to get the value associated with the specified key, parsed as the specified type using invariant culture formatting, with control over whether parsing errors should be treated as missing keys. |
| TryGetValue<T>(string, out bool, out T?) | Attempts to get the value associated with the specified key, parsed as the specified type using invariant culture formatting. |
| TryGetValue<T>(string, out T?) | Attempts to get the value associated with the specified key, parsed as the specified type using invariant culture formatting. |
Operators
| Name | Description |
|---|---|
| operator ==(RouteQuery, RouteQuery) | Determines whether two RouteQuery instances are equal. |
| operator !=(RouteQuery, RouteQuery) | Determines whether two RouteQuery instances are not equal. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IEnumerable<(string Key, string Value)>.GetEnumerator() | Returns an enumerator that iterates through the collection. |
| IEnumerable.GetEnumerator() | Returns an enumerator that iterates through a collection. |