RouteValueDictionary Class

Definition

An IDictionary<TKey,TValue> type for route values.

C#
public class RouteValueDictionary : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IDictionary<string,object>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IReadOnlyDictionary<string,object>
Inheritance
RouteValueDictionary
Implements

Constructors

RouteValueDictionary()

Creates an empty RouteValueDictionary.

RouteValueDictionary(IEnumerable<KeyValuePair<String,Object>>)

Creates a RouteValueDictionary initialized with the specified values.

RouteValueDictionary(IEnumerable<KeyValuePair<String,String>>)

Creates a RouteValueDictionary initialized with the specified values.

RouteValueDictionary(Object)

Creates a RouteValueDictionary initialized with the specified values.

RouteValueDictionary(RouteValueDictionary)

Creates a RouteValueDictionary initialized with the specified dictionary.

Properties

Comparer

Gets the comparer for this dictionary.

Count

Gets the number of elements contained in the ICollection<T>.

Item[String]

Gets or sets the element with the specified key.

Keys

Gets an ICollection<T> containing the keys of the IDictionary<TKey,TValue>.

Values

Gets an ICollection<T> containing the values in the IDictionary<TKey,TValue>.

Methods

Add(String, Object)

Adds an element with the provided key and value to the IDictionary<TKey,TValue>.

Clear()

Removes all items from the ICollection<T>.

ContainsKey(String)

Determines whether the IDictionary<TKey,TValue> contains an element with the specified key.

FromArray(KeyValuePair<String,Object>[])

Creates a new RouteValueDictionary from the provided array. The new instance will take ownership of the array, and may mutate it.

GetEnumerator() System.Object.GetEnumerator
Remove(String, Object)

Attempts to remove and return the value that has the specified key from the RouteValueDictionary.

Remove(String)

Removes the element with the specified key from the IDictionary<TKey,TValue>.

TryAdd(String, Object)

Attempts to the add the provided key and value to the dictionary.

TryGetValue(String, Object) System.Object.TryGetValue(System.String,System.Object@)

Explicit Interface Implementations

Applies to

Product Versions
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0