QueryString Struct¶
Provides correct handling for QueryString value when needed to reconstruct a request or redirect URI string
- Namespace
Microsoft.AspNetCore.Http
- Assemblies
- Microsoft.AspNetCore.Http.Abstractions
Syntax¶
public struct QueryString : IEquatable<QueryString>
-
struct
Microsoft.AspNetCore.Http.
QueryString
Constructors¶
-
QueryString
(System.String)¶ Initialize the query string with a given value. This value must be in escaped and delimited format with a leading ‘?’ character.
Arguments: value (System.String) – The query string to be assigned to the Value property. public QueryString(string value)
-
Methods¶
-
Add
(Microsoft.AspNetCore.Http.QueryString)¶ Return type: Microsoft.AspNetCore.Http.QueryString public QueryString Add(QueryString other)
-
Add
(System.String, System.String) Return type: Microsoft.AspNetCore.Http.QueryString public QueryString Add(string name, string value)
-
Create
(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, Microsoft.Extensions.Primitives.StringValues>>)¶ Creates a query string composed from the given name value pairs.
Return type: Microsoft.AspNetCore.Http.QueryString Returns: The resulting QueryString public static QueryString Create(IEnumerable<KeyValuePair<string, StringValues>> parameters)
-
Create
(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.String>>) Creates a query string composed from the given name value pairs.
Return type: Microsoft.AspNetCore.Http.QueryString Returns: The resulting QueryString public static QueryString Create(IEnumerable<KeyValuePair<string, string>> parameters)
-
Create
(System.String, System.String) Create a query string with a single given parameter name and value.
Arguments: - name (System.String) – The un-encoded parameter name
- value (System.String) – The un-encoded parameter value
Return type: Returns: The resulting QueryString
public static QueryString Create(string name, string value)
-
Equals
(Microsoft.AspNetCore.Http.QueryString)¶ Return type: System.Boolean public bool Equals(QueryString other)
-
Equals
(System.Object) Return type: System.Boolean public override bool Equals(object obj)
-
FromUriComponent
(System.String)¶ 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.
Arguments: uriComponent (System.String) – The escaped query as it appears in the URI format. Return type: Microsoft.AspNetCore.Http.QueryString Returns: The resulting QueryString public static QueryString FromUriComponent(string uriComponent)
-
FromUriComponent
(System.Uri) Returns an QueryString given the query as from a Uri object. Relative Uri objects are not supported.
Arguments: uri (System.Uri) – The Uri object Return type: Microsoft.AspNetCore.Http.QueryString Returns: The resulting QueryString public static QueryString FromUriComponent(Uri uri)
-
GetHashCode
()¶ Return type: System.Int32 public override int GetHashCode()
-
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.
Return type: System.String Returns: The query string value public override string ToString()
-
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.
Return type: System.String Returns: The query string value public string ToUriComponent()
-
Operators¶
-
Addition
(Microsoft.AspNetCore.Http.QueryString, Microsoft.AspNetCore.Http.QueryString)¶ Return type: Microsoft.AspNetCore.Http.QueryString public static QueryString operator +(QueryString left, QueryString right)
-
Equality
(Microsoft.AspNetCore.Http.QueryString, Microsoft.AspNetCore.Http.QueryString)¶ Return type: System.Boolean public static bool operator ==(QueryString left, QueryString right)
-
Inequality
(Microsoft.AspNetCore.Http.QueryString, Microsoft.AspNetCore.Http.QueryString)¶ Return type: System.Boolean public static bool operator !=(QueryString left, QueryString right)
-
Fields¶
-
Empty
()¶ Represents the empty query string. This field is read-only.
Return type: Microsoft.AspNetCore.Http.QueryString public static readonly QueryString Empty
-