ModelStateDictionaryExtensions.Remove<TModel> 方法

定义

expression 中移除指定的 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

类型参数

TModel

模型的类型。

参数

modelState
ModelStateDictionary

ModelStateDictionary此方法扩展的实例。

expression
Expression<Func<TModel,Object>>

要针对当前模型中的项计算的表达式。

返回

如果成功移除了该元素,则为 true;否则为 false。 如果在 expression 模型状态字典中找不到 ,则此方法也返回 false。

适用于