ModelStateDictionary.Add Method
Definition
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.
Overloads
Add(KeyValuePair<String,ModelState>) |
Adds the specified item to the model-state dictionary. |
Add(String, ModelState) |
Adds an element that has the specified key and value to the model-state dictionary. |
Add(KeyValuePair<String,ModelState>)
Adds the specified item to the model-state dictionary.
public void Add (System.Collections.Generic.KeyValuePair<string,System.Web.Mvc.ModelState> item);
abstract member Add : System.Collections.Generic.KeyValuePair<string, System.Web.Mvc.ModelState> -> unit
override this.Add : System.Collections.Generic.KeyValuePair<string, System.Web.Mvc.ModelState> -> unit
Public Sub Add (item As KeyValuePair(Of String, ModelState))
Parameters
- item
- KeyValuePair<String,ModelState>
The object to add to the model-state dictionary.
Implements
Exceptions
The model-state dictionary is read-only.
Applies to
Add(String, ModelState)
Adds an element that has the specified key and value to the model-state dictionary.
public void Add (string key, System.Web.Mvc.ModelState value);
abstract member Add : string * System.Web.Mvc.ModelState -> unit
override this.Add : string * System.Web.Mvc.ModelState -> unit
Public Sub Add (key As String, value As ModelState)
Parameters
- key
- String
The key of the element to add.
- value
- ModelState
The value of the element to add.
Implements
Exceptions
The model-state dictionary is read-only.
key
is null.
An element that has the specified key already occurs in the model-state dictionary.