QueryHelpers Class

Namespace
Microsoft.AspNetCore.WebUtilities
Assemblies
  • Microsoft.AspNetCore.WebUtilities

Syntax

public class QueryHelpers
class Microsoft.AspNetCore.WebUtilities.QueryHelpers

Methods

AddQueryString(System.String, System.Collections.Generic.IDictionary<System.String, System.String>)

Append the given query keys and values to the uri.

Arguments:
  • uri (System.String) – The base uri.
  • queryString (System.Collections.Generic.IDictionary<System.String>) – A collection of name value query pairs to append.
Return type:

System.String

Returns:

The combined result.

public static string AddQueryString(string uri, IDictionary<string, string> queryString)
AddQueryString(System.String, System.String, System.String)

Append the given query key and value to the URI.

Arguments:
  • uri (System.String) – The base URI.
  • name (System.String) – The name of the query key.
  • value (System.String) – The query value.
Return type:

System.String

Returns:

The combined result.

public static string AddQueryString(string uri, string name, string value)
ParseNullableQuery(System.String)

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

Arguments:queryString (System.String) – The raw query string value, with or without the leading ‘?’.
Return type:System.Collections.Generic.Dictionary<System.String>
Returns:A collection of parsed keys and values, null if there are no entries.
public static Dictionary<string, StringValues> ParseNullableQuery(string queryString)
ParseQuery(System.String)

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

Arguments:queryString (System.String) – The raw query string value, with or without the leading ‘?’.
Return type:System.Collections.Generic.Dictionary<System.String>
Returns:A collection of parsed keys and values.
public static Dictionary<string, StringValues> ParseQuery(string queryString)