TempDataDictionary Class¶
- Namespace
Microsoft.AspNetCore.Mvc.ViewFeatures
- Assemblies
- Microsoft.AspNetCore.Mvc.ViewFeatures
Syntax¶
public class TempDataDictionary : ITempDataDictionary, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
-
class
Microsoft.AspNetCore.Mvc.ViewFeatures.
TempDataDictionary
Constructors¶
-
TempDataDictionary
(Microsoft.AspNetCore.Http.HttpContext, Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataProvider)¶ Initializes a new instance of the
Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary
class.Arguments: - context (Microsoft.AspNetCore.Http.HttpContext) – The
Microsoft.AspNetCore.Http.HttpContext
. - provider (Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataProvider) – The
Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataProvider
used to Load and Save data.
public TempDataDictionary(HttpContext context, ITempDataProvider provider)
- context (Microsoft.AspNetCore.Http.HttpContext) – The
-
Methods¶
-
Add
(System.String, System.Object)¶ public void Add(string key, object value)
-
Clear
()¶ public void Clear()
-
ContainsKey
(System.String)¶ Return type: System.Boolean public bool ContainsKey(string key)
-
ContainsValue
(System.Object)¶ Return type: System.Boolean public bool ContainsValue(object value)
-
GetEnumerator
()¶ Return type: System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String>> public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
-
Keep
()¶ public void Keep()
-
Keep
(System.String) public void Keep(string key)
-
Load
()¶ public void Load()
-
Peek
(System.String)¶ Return type: System.Object public object Peek(string key)
-
Remove
(System.String)¶ Return type: System.Boolean public bool Remove(string key)
-
Save
()¶ public void Save()
-
Add
(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>)¶ 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)¶ void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int index)
-
Remove
(System.Collections.Generic.KeyValuePair<System.String, System.Object>) Return type: System.Boolean bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> keyValuePair)
-
GetEnumerator
() Return type: System.Collections.IEnumerator IEnumerator IEnumerable.GetEnumerator()
-
TryGetValue
(System.String, out System.Object)¶ Return type: System.Boolean public bool TryGetValue(string key, out object value)
-
Properties¶
-
Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary.
Count
¶ Return type: System.Int32 public int Count { get; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary.
Item[System.String]
¶ Return type: System.Object public object this[string key] { get; set; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary.
Keys
¶ Return type: System.Collections.Generic.ICollection<System.String> public ICollection<string> Keys { get; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary.
IsReadOnly
¶ Return type: System.Boolean bool ICollection<KeyValuePair<string, object>>.IsReadOnly { get; }
-
Microsoft.AspNetCore.Mvc.ViewFeatures.TempDataDictionary.
Values
¶ Return type: System.Collections.Generic.ICollection<System.Object> public ICollection<object> Values { get; }
-