PageModel.TryUpdateModelAsync 方法

定义

重载

TryUpdateModelAsync(Object, Type, String)

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

TryUpdateModelAsync(Object, Type, String, IValueProvider, Func<ModelMetadata,Boolean>)

使用 valueProvidername汇报指定的 model 实例。

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Expression<Func<TModel,Object>>[])

使用 valueProvidername汇报指定的 model 实例。

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Func<ModelMetadata,Boolean>)

使用 valueProvidername汇报指定的 model 实例。

TryUpdateModelAsync<TModel>(TModel, String, Expression<Func<TModel,Object>>[])

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider)

使用 valueProvidername汇报指定的 model 实例。

TryUpdateModelAsync<TModel>(TModel, String)

使用 的当前 IValueProvider中的值PageModel汇报指定的model实例。

TryUpdateModelAsync<TModel>(TModel)

使用 的当前 IValueProvider中的值PageModel汇报指定的model实例。

TryUpdateModelAsync<TModel>(TModel, String, Func<ModelMetadata,Boolean>)

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

TryUpdateModelAsync(Object, Type, String)

Source:
PageModel.cs
Source:
PageModel.cs

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

protected public:
 System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(System::Object ^ model, Type ^ modelType, System::String ^ name);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync (object model, Type modelType, string name);
member this.TryUpdateModelAsync : obj * Type * string -> System.Threading.Tasks.Task<bool>
Protected Friend Function TryUpdateModelAsync (model As Object, modelType As Type, name As String) As Task(Of Boolean)

参数

model
Object

要更新的模型实例。

modelType
Type

要更新的模型实例的类型。

name
String

在当前 IValueProvider中查找值时要使用的名称。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync(Object, Type, String, IValueProvider, Func<ModelMetadata,Boolean>)

Source:
PageModel.cs
Source:
PageModel.cs

使用 valueProvidername汇报指定的 model 实例。

protected public:
 System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(System::Object ^ model, Type ^ modelType, System::String ^ name, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider, Func<Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^, bool> ^ propertyFilter);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync (object model, Type modelType, string name, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, Func<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata,bool> propertyFilter);
member this.TryUpdateModelAsync : obj * Type * string * Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider * Func<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata, bool> -> System.Threading.Tasks.Task<bool>
Protected Friend Function TryUpdateModelAsync (model As Object, modelType As Type, name As String, valueProvider As IValueProvider, propertyFilter As Func(Of ModelMetadata, Boolean)) As Task(Of Boolean)

参数

model
Object

要更新的模型实例。

modelType
Type

要更新的模型实例的类型。

name
String

在 中 valueProvider查找值时要使用的名称。

valueProvider
IValueProvider

IValueProvider用于查找值的 。

propertyFilter
Func<ModelMetadata,Boolean>

可用于在运行时筛选属性的谓词。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Expression<Func<TModel,Object>>[])

Source:
PageModel.cs
Source:
PageModel.cs

使用 valueProvidername汇报指定的 model 实例。

protected public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ name, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider, ... cli::array <System::Linq::Expressions::Expression<Func<TModel, System::Object ^> ^> ^> ^ includeExpressions);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, params System.Linq.Expressions.Expression<Func<TModel,object>>[] includeExpressions) where TModel : class;
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, params System.Linq.Expressions.Expression<Func<TModel,object?>>[] includeExpressions) where TModel : class;
member this.TryUpdateModelAsync : 'Model * string * Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider * System.Linq.Expressions.Expression<Func<'Model, obj>>[] -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Protected Friend Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, name As String, valueProvider As IValueProvider, ParamArray includeExpressions As Expression(Of Func(Of TModel, Object))()) As Task(Of Boolean)

类型参数

TModel

模型对象的类型。

参数

model
TModel

要更新的模型实例。

name
String

在 中 valueProvider查找值时要使用的名称。

valueProvider
IValueProvider

IValueProvider用于查找值的 。

includeExpressions
Expression<Func<TModel,Object>>[]

Expression () 表示当前模型需要包含的顶级属性。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider, Func<ModelMetadata,Boolean>)

Source:
PageModel.cs
Source:
PageModel.cs

使用 valueProvidername汇报指定的 model 实例。

protected public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ name, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider, Func<Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^, bool> ^ propertyFilter);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, Func<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata,bool> propertyFilter) where TModel : class;
member this.TryUpdateModelAsync : 'Model * string * Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider * Func<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata, bool> -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Protected Friend Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, name As String, valueProvider As IValueProvider, propertyFilter As Func(Of ModelMetadata, Boolean)) As Task(Of Boolean)

类型参数

TModel

模型对象的类型。

参数

model
TModel

要更新的模型实例。

name
String

在 中 valueProvider查找值时要使用的名称。

valueProvider
IValueProvider

IValueProvider用于查找值的 。

propertyFilter
Func<ModelMetadata,Boolean>

可用于在运行时筛选属性的谓词。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync<TModel>(TModel, String, Expression<Func<TModel,Object>>[])

Source:
PageModel.cs
Source:
PageModel.cs

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

protected public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ name, ... cli::array <System::Linq::Expressions::Expression<Func<TModel, System::Object ^> ^> ^> ^ includeExpressions);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name, params System.Linq.Expressions.Expression<Func<TModel,object>>[] includeExpressions) where TModel : class;
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name, params System.Linq.Expressions.Expression<Func<TModel,object?>>[] includeExpressions) where TModel : class;
member this.TryUpdateModelAsync : 'Model * string * System.Linq.Expressions.Expression<Func<'Model, obj>>[] -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Protected Friend Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, name As String, ParamArray includeExpressions As Expression(Of Func(Of TModel, Object))()) As Task(Of Boolean)

类型参数

TModel

模型对象的类型。

参数

model
TModel

要更新的模型实例。

name
String

在当前 IValueProvider中查找值时要使用的名称。

includeExpressions
Expression<Func<TModel,Object>>[]

Expression () 表示当前模型需要包含的顶级属性。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider)

Source:
PageModel.cs
Source:
PageModel.cs

使用 valueProvidername汇报指定的 model 实例。

protected public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ name, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider) where TModel : class;
member this.TryUpdateModelAsync : 'Model * string * Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Protected Friend Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, name As String, valueProvider As IValueProvider) As Task(Of Boolean)

类型参数

TModel

模型对象的类型。

参数

model
TModel

要更新的模型实例。

name
String

在 中 valueProvider查找值时要使用的名称。

valueProvider
IValueProvider

IValueProvider用于查找值的 。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync<TModel>(TModel, String)

Source:
PageModel.cs
Source:
PageModel.cs

使用 的当前 IValueProvider中的值PageModel汇报指定的model实例。

protected public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ name);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name) where TModel : class;
member this.TryUpdateModelAsync : 'Model * string -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Protected Friend Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, name As String) As Task(Of Boolean)

类型参数

TModel

模型对象的类型。

参数

model
TModel

要更新的模型实例。

name
String

模型名称。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync<TModel>(TModel)

Source:
PageModel.cs
Source:
PageModel.cs

使用 的当前 IValueProvider中的值PageModel汇报指定的model实例。

protected public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model) where TModel : class;
member this.TryUpdateModelAsync : 'Model -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Protected Friend Function TryUpdateModelAsync(Of TModel As Class) (model As TModel) As Task(Of Boolean)

类型参数

TModel

模型对象的类型。

参数

model
TModel

要更新的模型实例。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于

TryUpdateModelAsync<TModel>(TModel, String, Func<ModelMetadata,Boolean>)

Source:
PageModel.cs
Source:
PageModel.cs

使用 的当前 IValueProvidername中的值PageModel汇报指定的model实例。

protected public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ name, Func<Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^, bool> ^ propertyFilter);
protected internal System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string name, Func<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata,bool> propertyFilter) where TModel : class;
member this.TryUpdateModelAsync : 'Model * string * Func<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata, bool> -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Protected Friend Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, name As String, propertyFilter As Func(Of ModelMetadata, Boolean)) As Task(Of Boolean)

类型参数

TModel

模型对象的类型。

参数

model
TModel

要更新的模型实例。

name
String

在当前 IValueProvider中查找值时要使用的名称。

propertyFilter
Func<ModelMetadata,Boolean>

可用于在运行时筛选属性的谓词。

返回

如果 Task 更新成功,则返回在完成时返回 true 的 。

适用于