TempDataDictionary Class

Syntax

public class TempDataDictionary : ITempDataDictionary, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable

GitHub

View on GitHub

class Microsoft.AspNet.Mvc.TempDataDictionary

Constructors

TempDataDictionary(IHttpContextAccessor, Microsoft.AspNet.Mvc.ITempDataProvider)

Initializes a new instance of the [Microsoft.AspNet.Mvc.TempDataDictionary](Microsoft.AspNet.Mvc.TempDataDictionary.yml) class.

Arguments:
  • context (IHttpContextAccessor) – The @!:IHttpContextAccessor- that provides the HttpContext.
  • provider (Microsoft.AspNet.Mvc.ITempDataProvider) – The [Microsoft.AspNet.Mvc.ITempDataProvider](Microsoft.AspNet.Mvc.ITempDataProvider.yml) used to Load and Save data.
public TempDataDictionary(IHttpContextAccessor context, ITempDataProvider provider)

Properties

Count()
Return type:System.Int32
public int Count { get; }
Microsoft.AspNet.Mvc.TempDataDictionary.Item[System.String]
Return type:System.Object
public object this[string key] { get; set; }
Keys()
Return type:System.Collections.Generic.ICollection{System.String}
public ICollection<string> Keys { get; }
IsReadOnly()
Return type:System.Boolean
bool ICollection<KeyValuePair<string, object>>.IsReadOnly { get; }
Values()
Return type:System.Collections.Generic.ICollection{System.Object}
public ICollection<object> Values { get; }

Methods

Add(System.String, System.Object)
Arguments:
  • key (System.String) –
  • value (System.Object) –
public void Add(string key, object value)
Microsoft.AspNet.Mvc.TempDataDictionary.Clear()
public void Clear()
ContainsKey(System.String)
Arguments:
  • key (System.String) –
Return type:

System.Boolean

public bool ContainsKey(string key)
ContainsValue(System.Object)
Arguments:
  • value (System.Object) –
Return type:

System.Boolean

public bool ContainsValue(object value)
Microsoft.AspNet.Mvc.TempDataDictionary.GetEnumerator()
Return type:System.Collections.Generic.IEnumerator{System.Collections.Generic.KeyValuePair{System.String,System.Object}}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Microsoft.AspNet.Mvc.TempDataDictionary.Keep()
public void Keep()
Keep(System.String)
Arguments:
  • key (System.String) –
public void Keep(string key)
Microsoft.AspNet.Mvc.TempDataDictionary.Load()
public void Load()
Peek(System.String)
Arguments:
  • key (System.String) –
Return type:

System.Object

public object Peek(string key)
Remove(System.String)
Arguments:
  • key (System.String) –
Return type:

System.Boolean

public bool Remove(string key)
Microsoft.AspNet.Mvc.TempDataDictionary.Save()
public void Save()
Add(System.Collections.Generic.KeyValuePair<System.String, System.Object>)
Arguments:
  • keyValuePair (System.Collections.Generic.KeyValuePair{System.String,System.Object}) –
void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> keyValuePair)
Contains(System.Collections.Generic.KeyValuePair<System.String, System.Object>)
Arguments:
  • keyValuePair (System.Collections.Generic.KeyValuePair{System.String,System.Object}) –
Return type:

System.Boolean

bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> keyValuePair)
CopyTo(System.Collections.Generic.KeyValuePair<System.String, System.Object>[], System.Int32)
Arguments:
  • array (System.Collections.Generic.KeyValuePair{System.String,System.Object}[]) –
  • index (System.Int32) –
void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int index)
Remove(System.Collections.Generic.KeyValuePair<System.String, System.Object>)
Arguments:
  • keyValuePair (System.Collections.Generic.KeyValuePair{System.String,System.Object}) –
Return type:

System.Boolean

bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> keyValuePair)
Microsoft.AspNet.Mvc.TempDataDictionary.System.Collections.IEnumerable.GetEnumerator()
Return type:System.Collections.IEnumerator
IEnumerator IEnumerable.GetEnumerator()
TryGetValue(System.String, out System.Object)
Arguments:
  • key (System.String) –
  • value (System.Object) –
Return type:

System.Boolean

public bool TryGetValue(string key, out object value)