Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

struct Microsoft.​AspNetCore.​Http.​QueryString

Assembly: Microsoft.AspNetCore.Http.Abstractions

Implemented Interfaces

Provides correct handling for QueryString value when needed to reconstruct a request or redirect URI string

Fields and Constants

public static readonly QueryString
Empty
Represents the empty query string. This field is read-only.

Properties

public string
Value
The escaped query string with the leading '?' character
public bool
HasValue
True if the query string is not empty

Methods

public string
ToString​()
Provides the query string escaped in a way which is correct for combining into the URI representation. A leading '?' character will be included unless the Value is null or empty. Characters which are potentially dangerous are escaped.
Returns The query string value
public string
ToUriComponent​()
Provides the query string escaped in a way which is correct for combining into the URI representation. A leading '?' character will be included unless the Value is null or empty. Characters which are potentially dangerous are escaped.
Returns The query string value
public static QueryString
FromUriComponent​(string uriComponent)
Returns an QueryString given the query as it is escaped in the URI format. The string MUST NOT contain any value that is not a query.
Returns The resulting QueryString
uriComponent The escaped query as it appears in the URI format.
public static QueryString
FromUriComponent​(System.​Uri uri)
Returns an QueryString given the query as from a Uri object. Relative Uri objects are not supported.
Returns The resulting QueryString
uri The Uri object
public static QueryString
Create​(string name, string value)
Create a query string with a single given parameter name and value.
Returns The resulting QueryString
name The un-encoded parameter name
value The un-encoded parameter value
public static QueryString
Create​(System.​Collections.​Generic.​IEnumerable<​System.​Collections.​Generic.​KeyValuePair<​string, string>> parameters)
Creates a query string composed from the given name value pairs.
Returns The resulting QueryString
public static QueryString
Create​(System.​Collections.​Generic.​IEnumerable<​System.​Collections.​Generic.​KeyValuePair<​string, Extensions.​Primitives.​StringValues>> parameters)
Creates a query string composed from the given name value pairs.
Returns The resulting QueryString
public QueryString
Add​(QueryString other)
Concatenates <paramref name="other" /> to the current query string.
Returns The concatenated <see cref="T:Microsoft.AspNetCore.Http.QueryString" /> .
other The <see cref="T:Microsoft.AspNetCore.Http.QueryString" /> to concatenate.
public QueryString
Add​(string name, string value)
Concatenates a query string with <paramref name="name" /> and <paramref name="value" /> to the current query string.
Returns The concatenated <see cref="T:Microsoft.AspNetCore.Http.QueryString" /> .
name The name of the query string to concatenate.
value The value of the query string to concatenate.
public bool
Equals​(QueryString other)
Evalutes if the current query string is equal to <paramref name="other" /> .
Returns <see langword="true" /> if the query strings are equal.
other The <see cref="T:Microsoft.AspNetCore.Http.QueryString" /> to compare.
public bool
Equals​(object obj)
Evaluates if the current query string is equal to an object <paramref name="obj" /> .
Returns <see langword="true" /> if the query strings are equal.
obj An object to compare.
public int
GetHashCode​()
Gets a hash code for the value.
Returns The hash code as an <see cref="T:System.Int32" /> .
protected void
Finalize​()
Inherited from object
GetType​()
Inherited from object
protected object
MemberwiseClone​()
Inherited from object