Table of Contents

Class QueryHelper

Namespace
BootstrapBlazor.Components
Assembly
BootstrapBlazor.dll

Provides methods for parsing and manipulating query strings.

public static class QueryHelper
Inheritance
QueryHelper
Inherited Members

Methods

AddQueryString(string, IDictionary<string, string?>)

Append the given query keys and values to the URI.

public static string AddQueryString(string uri, IDictionary<string, string?> queryString)

Parameters

uri string

The base URI.

queryString IDictionary<string, string>

A dictionary of query keys and values to append.

Returns

string

The combined result.

Exceptions

ArgumentNullException

uri is null.

ArgumentNullException

queryString is null.

AddQueryString(string, IEnumerable<KeyValuePair<string, StringValues>>)

Append the given query keys and values to the URI.

public static string AddQueryString(string uri, IEnumerable<KeyValuePair<string, StringValues>> queryString)

Parameters

uri string

The base URI.

queryString IEnumerable<KeyValuePair<string, StringValues>>

A collection of query names and values to append.

Returns

string

The combined result.

Exceptions

ArgumentNullException

uri is null.

ArgumentNullException

queryString is null.

AddQueryString(string, IEnumerable<KeyValuePair<string, string?>>)

Append the given query keys and values to the URI.

public static string AddQueryString(string uri, IEnumerable<KeyValuePair<string, string?>> queryString)

Parameters

uri string

The base URI.

queryString IEnumerable<KeyValuePair<string, string>>

A collection of name value query pairs to append.

Returns

string

The combined result.

Exceptions

ArgumentNullException

uri is null.

ArgumentNullException

queryString is null.

AddQueryString(string, string, string)

Append the given query key and value to the URI.

public static string AddQueryString(string uri, string name, string value)

Parameters

uri string

The base URI.

name string

The name of the query key.

value string

The query value.

Returns

string

The combined result.

Exceptions

ArgumentNullException

uri is null.

ArgumentNullException

name is null.

ArgumentNullException

value is null.

ParseNullableQuery(string?)

Parse a query string into its component key and value parts.

public static Dictionary<string, StringValues>? ParseNullableQuery(string? queryString)

Parameters

queryString string

The raw query string value, with or without the leading '?'.

Returns

Dictionary<string, StringValues>

A collection of parsed keys and values, null if there are no entries.

ParseQuery(string?)

Parse a query string into its component key and value parts.

public static Dictionary<string, StringValues> ParseQuery(string? queryString)

Parameters

queryString string

The raw query string value, with or without the leading '?'.

Returns

Dictionary<string, StringValues>

A collection of parsed keys and values.