ViewDataDictionary<TModel> 类

定义

表示特定模型类型的值 ViewDataDictionary

generic <typename TModel>
public ref class ViewDataDictionary : Microsoft::AspNetCore::Mvc::ViewFeatures::ViewDataDictionary
public class ViewDataDictionary<TModel> : Microsoft.AspNetCore.Mvc.ViewFeatures.ViewDataDictionary
type ViewDataDictionary<'Model> = class
    inherit ViewDataDictionary
Public Class ViewDataDictionary(Of TModel)
Inherits ViewDataDictionary

类型参数

TModel

模型的类型。

继承
ViewDataDictionary<TModel>

构造函数

ViewDataDictionary<TModel>(IModelMetadataProvider, ModelStateDictionary)

初始化 ViewDataDictionary<TModel> 类的新实例。

ViewDataDictionary<TModel>(ViewDataDictionary)

基于现有ViewDataDictionary实例的一部分初始化类的新实例ViewDataDictionary<TModel>

ViewDataDictionary<TModel>(ViewDataDictionary, Object)

基于现有ViewDataDictionary实例的一部分初始化类的新实例ViewDataDictionary<TModel>。 此构造函数小心翼翼,以避免当为 nullmodel可能会引发异常SetModel(Object)

属性

Count (继承自 ViewDataDictionary)
IsReadOnly (继承自 ViewDataDictionary)
Item[String] (继承自 ViewDataDictionary)
Keys (继承自 ViewDataDictionary)
Model

获取或设置当前模型。

ModelExplorer

获取或设置 ModelExplorerModel

(继承自 ViewDataDictionary)
ModelMetadata

获取 ModelMetadata 表达式、 Modelnull) 或声明 Type的表达式 (。

(继承自 ViewDataDictionary)
ModelState

获取 ModelStateDictionary

(继承自 ViewDataDictionary)
TemplateInfo

获取 TemplateInfo

(继承自 ViewDataDictionary)
Values (继承自 ViewDataDictionary)

方法

Add(KeyValuePair<String,Object>) (继承自 ViewDataDictionary)
Add(String, Object) (继承自 ViewDataDictionary)
Clear() (继承自 ViewDataDictionary)
Contains(KeyValuePair<String,Object>) (继承自 ViewDataDictionary)
ContainsKey(String) (继承自 ViewDataDictionary)
CopyTo(KeyValuePair<String,Object>[], Int32) (继承自 ViewDataDictionary)
Eval(String)

获取在此ViewDataDictionary名称中命名expression的值。

(继承自 ViewDataDictionary)
Eval(String, String)

获取采用给定format格式的命名ViewDataDictionaryexpression值。

(继承自 ViewDataDictionary)
GetViewDataInfo(String)

获取ViewDataInfoViewDataDictionary名称expression

(继承自 ViewDataDictionary)
Remove(KeyValuePair<String,Object>) (继承自 ViewDataDictionary)
Remove(String) (继承自 ViewDataDictionary)
SetModel(Object)

设置为 ModelExplorer 确保 ModelModel 反映新 value

(继承自 ViewDataDictionary)
TryGetValue(String, Object) (继承自 ViewDataDictionary)

显式接口实现

IEnumerable.GetEnumerator() (继承自 ViewDataDictionary)
IEnumerable<KeyValuePair<String,Object>>.GetEnumerator() (继承自 ViewDataDictionary)

适用于