ModelStateDictionary.Remove Method

Definition

Overloads

Remove(KeyValuePair<String,ModelState>)

Removes the first occurrence of the specified object from the model-state dictionary.

Remove(String)

Removes the element that has the specified key from the model-state dictionary.

Remove(KeyValuePair<String,ModelState>)

Removes the first occurrence of the specified object from the model-state dictionary.

public bool Remove (System.Collections.Generic.KeyValuePair<string,System.Web.Mvc.ModelState> item);
abstract member Remove : System.Collections.Generic.KeyValuePair<string, System.Web.Mvc.ModelState> -> bool
override this.Remove : System.Collections.Generic.KeyValuePair<string, System.Web.Mvc.ModelState> -> bool
Public Function Remove (item As KeyValuePair(Of String, ModelState)) As Boolean

Parameters

item
KeyValuePair<String,ModelState>

The object to remove from the model-state dictionary.

Returns

true if item was successfully removed the model-state dictionary; otherwise, false. This method also returns false if item is not found in the model-state dictionary.

Implements

Exceptions

The model-state dictionary is read-only.

Applies to

Remove(String)

Removes the element that has the specified key from the model-state dictionary.

public bool Remove (string key);
abstract member Remove : string -> bool
override this.Remove : string -> bool
Public Function Remove (key As String) As Boolean

Parameters

key
String

The key of the element to remove.

Returns

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the model-state dictionary.

Implements

Exceptions

The model-state dictionary is read-only.

key is null.

Applies to