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<TModel>基于现有实例的部分初始化类的新实例 ViewDataDictionary

ViewDataDictionary<TModel>(ViewDataDictionary, Object)

ViewDataDictionary<TModel>基于现有实例的部分初始化类的新实例 ViewDataDictionarySetModel(Object)modelnull时,此构造函数将小心避免可能引发异常。

属性

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

获取或设置当前模型。

ModelExplorer

获取或设置 ModelExplorerModel

(继承自 ViewDataDictionary)
ModelMetadata

获取 ModelMetadata 表达式的, Model 如果) 为非null ,则为 (; 否则为 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)

获取此中命名的的值 expression ViewDataDictionary

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

获取 expression 在此中命名的值 ViewDataDictionary ,使用给定的格式化 format

(继承自 ViewDataDictionary)
GetViewDataInfo(String)

获取 ViewDataInfo expression 此中命名的 ViewDataDictionary

(继承自 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)

适用于