ITempData 接口
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
提供用于存储后续请求所需的数据的字典。 在读取 TempData 中存储的数据除非 Keep() 或被调用, Keep(String) 或者通过该 Peek(String)数据进行访问,否则会自动删除存储在 TempData 中的数据。
public interface ITempData : 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 ITempData = interface
interface IDictionary<string, obj>
interface ICollection<KeyValuePair<string, obj>>
interface seq<KeyValuePair<string, obj>>
interface IEnumerable
Public Interface ITempData
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object))
- 实现
-
ICollection<KeyValuePair<String,Object>> ICollection<KeyValuePair<TKey,TValue>> IDictionary<String,Object> IEnumerable<KeyValuePair<String,Object>> IEnumerable<KeyValuePair<TKey,TValue>> IEnumerable<T> IEnumerable
方法
| 名称 | 说明 |
|---|---|
| Get(String) |
获取与指定键关联的值,然后计划其删除。 |
| Keep() |
使 TempData 中当前存在的所有密钥保留为另一个请求。 |
| Keep(String) |
为另一个请求保留元素 |
| Peek(String) |
获取与指定键关联的值,而无需计划删除它。 |