ModelStateDictionary.Remove Method

Definition

Removes an element from the dictionary.

Overloads

Remove(KeyValuePair<String,ModelState>)

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

Remove(String)

Removes the item that has the specified key from the dictionary.

Remove(KeyValuePair<String,ModelState>)

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

C#
public bool Remove(System.Collections.Generic.KeyValuePair<string,System.Web.ModelBinding.ModelState> item);

Parameters

item
KeyValuePair<String,ModelState>

The item to remove.

Returns

true if the item was successfully removed from the dictionary, or false if the item was not removed or was not found in the dictionary.

Implements

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

Remove(String)

Removes the item that has the specified key from the dictionary.

C#
public bool Remove(string key);

Parameters

key
String

The key of the item to remove.

Returns

true if the item was successfully removed from the dictionary, or false if the item was not removed or was not found in the dictionary.

Implements

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1