TempDataDictionary Class

Definition

Represents a set of data that persists only from one request to the next.

C#
public class TempDataDictionary : Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionary, 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>>
Inheritance
TempDataDictionary
Implements

Constructors

Properties

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.

ContainsValue(Object) System.Object.ContainsValue(System.Object)
GetEnumerator()

Returns an enumerator that iterates through the collection.

Keep()

Marks all keys in the dictionary for retention.

Keep(String)

Marks the specified key in the dictionary for retention.

Load()

Loads the dictionary by using the registered ITempDataProvider.

Peek(String)

Returns an object that contains the element that is associated with the specified key, without marking the key for deletion.

Remove(String)

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

Save()

Saves the dictionary by using the registered ITempDataProvider.

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

Explicit Interface Implementations

Applies to

Tuote Versiot
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