Delen via


TempDataDictionary Class

Definition

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

public ref class TempDataDictionary : Microsoft::AspNetCore::Mvc::ViewFeatures::ITempDataDictionary, System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>, System::Collections::Generic::IDictionary<System::String ^, System::Object ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>
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>>
type TempDataDictionary = class
    interface ITempDataDictionary
    interface IDictionary<string, obj>
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
type TempDataDictionary = class
    interface ITempDataDictionary
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
    interface IDictionary<string, obj>
Public Class TempDataDictionary
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object)), ITempDataDictionary
Inheritance
TempDataDictionary
Implements

Constructors

TempDataDictionary(HttpContext, ITempDataProvider)

Initializes a new instance of the TempDataDictionary class.

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

ICollection<KeyValuePair<String,Object>>.Add(KeyValuePair<String,Object>)
ICollection<KeyValuePair<String,Object>>.Contains(KeyValuePair<String,Object>)
ICollection<KeyValuePair<String,Object>>.CopyTo(KeyValuePair<String,Object>[], Int32)
ICollection<KeyValuePair<String,Object>>.IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

ICollection<KeyValuePair<String,Object>>.Remove(KeyValuePair<String,Object>)
IEnumerable.GetEnumerator()

Applies to