QueryCollection Class

The HttpRequest query string collection

Namespace
Microsoft.AspNetCore.Http.Internal
Assemblies
  • Microsoft.AspNetCore.Http

Syntax

public class QueryCollection : IQueryCollection, IEnumerable<KeyValuePair<string, StringValues>>, IEnumerable
class Microsoft.AspNetCore.Http.Internal.QueryCollection

Constructors

QueryCollection()
public QueryCollection()
QueryCollection(Microsoft.AspNetCore.Http.Internal.QueryCollection)
public QueryCollection(QueryCollection store)
QueryCollection(System.Collections.Generic.Dictionary<System.String, Microsoft.Extensions.Primitives.StringValues>)
public QueryCollection(Dictionary<string, StringValues> store)
QueryCollection(System.Int32)
public QueryCollection(int capacity)

Methods

ContainsKey(System.String)

Determines whether the Microsoft.AspNetCore.Http.HeaderDictionary contains a specific key.

Arguments:key (System.String) – The key.
Return type:System.Boolean
Returns:true if the Microsoft.AspNetCore.Http.HeaderDictionary contains a specific key; otherwise, false.
public bool ContainsKey(string key)
GetEnumerator()

Returns an enumerator that iterates through a collection.

Return type:Microsoft.AspNetCore.Http.Internal.QueryCollection.Enumerator
Returns:An Microsoft.AspNetCore.Http.Internal.QueryCollection.Enumerator object that can be used to iterate through the collection.
public QueryCollection.Enumerator GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through a collection.

Return type:System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String>>
Returns:An System.Collections.Generic.IEnumerator`1 object that can be used to iterate through the collection.
IEnumerator<KeyValuePair<string, StringValues>> IEnumerable<KeyValuePair<string, StringValues>>.GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through a collection.

Return type:System.Collections.IEnumerator
Returns:An System.Collections.IEnumerator object that can be used to iterate through the collection.
IEnumerator IEnumerable.GetEnumerator()
TryGetValue(System.String, out Microsoft.Extensions.Primitives.StringValues)

Retrieves a value from the dictionary.

Arguments:
Return type:

System.Boolean

Returns:

true if the Microsoft.AspNetCore.Http.HeaderDictionary contains the key; otherwise, false.

public bool TryGetValue(string key, out StringValues value)

Fields

Empty()
Return type:Microsoft.AspNetCore.Http.Internal.QueryCollection
public static readonly QueryCollection Empty

Properties

Microsoft.AspNetCore.Http.Internal.QueryCollection.Count

Gets the number of elements contained in the Microsoft.AspNetCore.Http.HeaderDictionary;.

Return type:System.Int32
Returns:The number of elements contained in the Microsoft.AspNetCore.Http.HeaderDictionary.
public int Count { get; }
Microsoft.AspNetCore.Http.Internal.QueryCollection.Item[System.String]

Get or sets the associated value from the collection as a single string.

Arguments:key (System.String) – The header name.
Return type:Microsoft.Extensions.Primitives.StringValues
Returns:the associated value from the collection as a StringValues or StringValues.Empty if the key is not present.
public StringValues this[string key] { get; }
Microsoft.AspNetCore.Http.Internal.QueryCollection.Keys
Return type:System.Collections.Generic.ICollection<System.String>
public ICollection<string> Keys { get; }