ModelStateDictionaryExtensions.Remove<TModel>(ModelStateDictionary, Expression<Func<TModel,Object>>) Method

Definition

Removes the specified expression from the ModelStateDictionary.

public:
generic <typename TModel>
[System::Runtime::CompilerServices::Extension]
 static bool Remove(Microsoft::AspNetCore::Mvc::ModelBinding::ModelStateDictionary ^ modelState, System::Linq::Expressions::Expression<Func<TModel, System::Object ^> ^> ^ expression);
public static bool Remove<TModel> (this Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary modelState, System.Linq.Expressions.Expression<Func<TModel,object>> expression);
static member Remove : Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary * System.Linq.Expressions.Expression<Func<'Model, obj>> -> bool
<Extension()>
Public Function Remove(Of TModel) (modelState As ModelStateDictionary, expression As Expression(Of Func(Of TModel, Object))) As Boolean

Type Parameters

TModel

The type of the model.

Parameters

modelState
ModelStateDictionary

The ModelStateDictionary instance this method extends.

expression
Expression<Func<TModel,Object>>

An expression to be evaluated against an item in the current model.

Returns

Boolean

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

Applies to