ViewDataDictionary 类

定义

视图数据的 A IDictionary<TKey,TValue>

public ref class ViewDataDictionary : System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>, System::Collections::Generic::IDictionary<System::String ^, System::Object ^>, System::Collections::Generic::IEnumerable<System::Collections::Generic::KeyValuePair<System::String ^, System::Object ^>>
public class ViewDataDictionary : 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 ViewDataDictionary = class
    interface IDictionary<string, obj>
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
type ViewDataDictionary = class
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
    interface IDictionary<string, obj>
Public Class ViewDataDictionary
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object))
继承
ViewDataDictionary
派生
实现

构造函数

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary)

初始化 ViewDataDictionary 类的新实例。

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary, Type)

初始化 ViewDataDictionary 类的新实例。

ViewDataDictionary(IModelMetadataProvider, Type)

初始化 ViewDataDictionary 类的新实例。

ViewDataDictionary(ViewDataDictionary)

完全基于现有实例初始化类的新实例 ViewDataDictionary

ViewDataDictionary(ViewDataDictionary, Object, Type)

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

ViewDataDictionary(ViewDataDictionary, Type)

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

属性

Count

Gets the number of elements contained in the ICollection<T>.

IsReadOnly

Gets a value indicating whether the ICollection<T> is read-only.

Item[String]

Gets or sets the element with the specified key.

Keys

Gets an ICollection<T> containing the keys of the IDictionary<TKey,TValue>.

Model

获取或设置当前模型。

ModelExplorer

获取或设置 ModelExplorerModel

ModelMetadata

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

ModelState

获取 ModelStateDictionary

TemplateInfo

获取 TemplateInfo

Values

Gets an ICollection<T> containing the values in the IDictionary<TKey,TValue>.

方法

Add(KeyValuePair<String,Object>)

Adds an item to the ICollection<T>.

Add(String, Object)

Adds an element with the provided key and value to the IDictionary<TKey,TValue>.

Clear()

Removes all items from the ICollection<T>.

Contains(KeyValuePair<String,Object>)

Determines whether the ICollection<T> contains a specific value.

ContainsKey(String)

Determines whether the IDictionary<TKey,TValue> contains an element with the specified key.

CopyTo(KeyValuePair<String,Object>[], Int32)

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

Eval(String)

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

Eval(String, String)

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

FormatValue(Object, String)

使用给定的给定valueformat格式。

GetViewDataInfo(String)

获取ViewDataInfoViewDataDictionary名称expression

Remove(KeyValuePair<String,Object>)

Removes the first occurrence of a specific object from the ICollection<T>.

Remove(String)

Removes the element with the specified key from the IDictionary<TKey,TValue>.

SetModel(Object)

设置为 ModelExplorer 确保 ModelModel 反映新 value

TryGetValue(String, Object) System.Object.TryGetValue(System.String,System.Object@)

显式接口实现

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerable<KeyValuePair<String,Object>>.GetEnumerator()

Returns an enumerator that iterates through the collection.

适用于