ViewDataDictionary Class

Definition

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>>
Inheritance
ViewDataDictionary
Derived
Implements

Constructors

ViewDataDictionary(ViewDataDictionary)

Initializes a new instance of the ViewDataDictionary class based entirely on an existing instance.

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary)

Initializes a new instance of the ViewDataDictionary class.

ViewDataDictionary(IModelMetadataProvider, Type)

Initializes a new instance of the ViewDataDictionary class.

ViewDataDictionary(ViewDataDictionary, Type)

Initializes a new instance of the ViewDataDictionary class based in part on an existing instance.

ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary, Type)

Initializes a new instance of the ViewDataDictionary class.

ViewDataDictionary(ViewDataDictionary, Object, Type)

Initializes a new instance of the ViewDataDictionary class based in part on an existing instance. This constructor is careful to avoid exceptions SetModel(Object) may throw when model is null.

Properties

Count
IsReadOnly
Item[String]
Keys
Model

Gets or sets the current model.

ModelExplorer

Gets or sets the ModelExplorer for the Model.

ModelMetadata

Gets the ModelMetadata for an expression, the Model (if non-null), or the declared Type.

ModelState

Gets the ModelStateDictionary.

TemplateInfo

Gets the TemplateInfo.

Values

Methods

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

Gets value of named expression in this ViewDataDictionary.

Eval(String, String)

Gets value of named expression in this ViewDataDictionary, formatted using given format.

FormatValue(Object, String)

Formats the given value using given format.

GetViewDataInfo(String)

Gets ViewDataInfo for named expression in this ViewDataDictionary.

Remove(KeyValuePair<String,Object>)
Remove(String)
SetModel(Object)

Set ModelExplorer to ensure Model and Model reflect the new value.

TryGetValue(String, Object)

Explicit Interface Implementations

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

Extension Methods

GetWrapperProvider(IEnumerable<IWrapperProviderFactory>, WrapperProviderContext)

Gets an instance of IWrapperProvider for the supplied type.

FirstHtmlSymbolAs(IEnumerable<ISymbol>, HtmlSymbolType)

Converts the generic IEnumerable<T> to a IEnumerable<T> and finds the first HtmlSymbol with type type.

GetContent(IEnumerable<ISymbol>, SourceLocation)

Applies to