Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
ViewDataDictionary Class
Definition
- Namespace:
- Microsoft.AspNetCore.Mvc.ViewFeatures
- Assembly:
- Microsoft.AspNetCore.Mvc.ViewFeatures.dll
- Package:
- Microsoft.AspNetCore.Mvc.ViewFeatures v1.0.0
- Package:
- Microsoft.AspNetCore.Mvc.ViewFeatures v1.1.0
- Package:
- Microsoft.AspNetCore.App.Ref v10.0.0
- Package:
- Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
- Package:
- Microsoft.AspNetCore.Mvc.ViewFeatures v2.0.0
- Package:
- Microsoft.AspNetCore.Mvc.ViewFeatures v2.1.0
- Package:
- Microsoft.AspNetCore.Mvc.ViewFeatures v2.2.0
- Package:
- Microsoft.AspNetCore.App.Ref v3.0.1
- Package:
- Microsoft.AspNetCore.App.Ref v3.1.10
- Package:
- Microsoft.AspNetCore.App.Ref v5.0.0
- Package:
- Microsoft.AspNetCore.App.Ref v6.0.36
- Package:
- Microsoft.AspNetCore.App.Ref v7.0.5
- Package:
- Microsoft.AspNetCore.App.Ref v8.0.19
- Package:
- Microsoft.AspNetCore.App.Ref v9.0.8
- Source:
- ViewDataDictionary.cs
- Source:
- ViewDataDictionary.cs
- Source:
- ViewDataDictionary.cs
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A IDictionary<TKey,TValue> for view data.
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))
- Inheritance
-
ViewDataDictionary
- Derived
- Implements
-
ICollection<KeyValuePair<String,Object>> ICollection<KeyValuePair<TKey,TValue>> IDictionary<String,Object> IEnumerable<KeyValuePair<String,Object>> IEnumerable<KeyValuePair<TKey,TValue>> IEnumerable<T> IEnumerable
Constructors
| Name | Description |
|---|---|
| ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary, Type) |
Initializes a new instance of the ViewDataDictionary class. |
| ViewDataDictionary(IModelMetadataProvider, ModelStateDictionary) |
Initializes a new instance of the ViewDataDictionary class. |
| ViewDataDictionary(IModelMetadataProvider, 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
|
| ViewDataDictionary(ViewDataDictionary, Type) |
Initializes a new instance of the ViewDataDictionary class based in part on an existing instance. |
| ViewDataDictionary(ViewDataDictionary) |
Initializes a new instance of the ViewDataDictionary class based entirely on an existing instance. |
Properties
| Name | Description |
|---|---|
| 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 |
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- |
| ModelState |
Gets the ModelStateDictionary. |
| TemplateInfo |
Gets the TemplateInfo. |
| Values | Gets an ICollection<T> containing the values in the IDictionary<TKey,TValue>. |
Methods
| Name | Description |
|---|---|
| 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, String) |
Gets value of named |
| Eval(String) |
Gets value of named |
| FormatValue(Object, String) |
Formats the given |
| GetViewDataInfo(String) |
Gets ViewDataInfo for named |
| 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) |
Set ModelExplorer to ensure Model and Model
reflect the new |
| TryGetValue(String, Object) | |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IEnumerable.GetEnumerator() | Returns an enumerator that iterates through a collection. |
| IEnumerable<KeyValuePair<String,Object>>.GetEnumerator() | Returns an enumerator that iterates through the collection. |
Applies to
Feedback
Was this page helpful?
