ControllerBase.TryUpdateModelAsync 方法

定義

多載

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

model使用和來更新指定的實例 valueProvider prefix

TryUpdateModelAsync(Object, Type, String)

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

TryUpdateModelAsync<TModel>(TModel)

model使用來自控制器目前的值,更新指定的實例 IValueProvider

TryUpdateModelAsync<TModel>(TModel, String)

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider)

model使用和來更新指定的實例 valueProvider prefix

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

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

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

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

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

model使用和來更新指定的實例 valueProvider prefix

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

model使用和來更新指定的實例 valueProvider prefix

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

model使用和來更新指定的實例 valueProvider prefix

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

參數

model
Object

要更新的模型執行個體。

modelType
Type

要更新之模型實例的型別。

prefix
String

在中查閱值時要使用的前置詞 valueProvider

valueProvider
IValueProvider

IValueProvider用於查閱值的。

propertyFilter
Func<ModelMetadata,Boolean>

可以用來在執行時間篩選屬性的述詞。

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

TryUpdateModelAsync(Object, Type, String)

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

public:
 virtual System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(System::Object ^ model, Type ^ modelType, System::String ^ prefix);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual System.Threading.Tasks.Task<bool> TryUpdateModelAsync (object model, Type modelType, string prefix);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member TryUpdateModelAsync : obj * Type * string -> System.Threading.Tasks.Task<bool>
override this.TryUpdateModelAsync : obj * Type * string -> System.Threading.Tasks.Task<bool>
Public Overridable Function TryUpdateModelAsync (model As Object, modelType As Type, prefix As String) As Task(Of Boolean)

參數

model
Object

要更新的模型執行個體。

modelType
Type

要更新之模型實例的型別。

prefix
String

在目前的中查閱值時要使用的前置詞 IValueProvider

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

TryUpdateModelAsync<TModel>(TModel)

model使用來自控制器目前的值,更新指定的實例 IValueProvider

public:
generic <typename TModel>
 where TModel : class virtual System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model) where TModel : class;
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member TryUpdateModelAsync : 'Model -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
override this.TryUpdateModelAsync : 'Model -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Public Overridable Function TryUpdateModelAsync(Of TModel As Class) (model As TModel) As Task(Of Boolean)

類型參數

TModel

模型物件的型別。

參數

model
TModel

要更新的模型執行個體。

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

TryUpdateModelAsync<TModel>(TModel, String)

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

public:
generic <typename TModel>
 where TModel : class virtual System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ prefix);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string prefix) where TModel : class;
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member TryUpdateModelAsync : 'Model * string -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
override this.TryUpdateModelAsync : 'Model * string -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Public Overridable Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, prefix As String) As Task(Of Boolean)

類型參數

TModel

模型物件的型別。

參數

model
TModel

要更新的模型執行個體。

prefix
String

在目前的中查閱值時要使用的前置詞 IValueProvider

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

TryUpdateModelAsync<TModel>(TModel, String, IValueProvider)

model使用和來更新指定的實例 valueProvider prefix

public:
generic <typename TModel>
 where TModel : class virtual System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ prefix, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string prefix, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider) where TModel : class;
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member TryUpdateModelAsync : 'Model * string * Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
override this.TryUpdateModelAsync : 'Model * string * Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider -> System.Threading.Tasks.Task<bool> (requires 'Model : null)
Public Overridable Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, prefix As String, valueProvider As IValueProvider) As Task(Of Boolean)

類型參數

TModel

模型物件的型別。

參數

model
TModel

要更新的模型執行個體。

prefix
String

在中查閱值時要使用的前置詞 valueProvider

valueProvider
IValueProvider

IValueProvider用於查閱值的。

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

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

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

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

類型參數

TModel

模型物件的型別。

參數

model
TModel

要更新的模型執行個體。

prefix
String

在目前的中查閱值時要使用的前置詞 IValueProvider

propertyFilter
Func<ModelMetadata,Boolean>

可以用來在執行時間篩選屬性的述詞。

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

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

model使用來自控制器目前和的值,更新指定的實例 IValueProvider prefix

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

類型參數

TModel

模型物件的型別。

參數

model
TModel

要更新的模型執行個體。

prefix
String

在目前的中查閱值時要使用的前置詞 IValueProvider

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

Expression (s) ,代表需要包含在目前模型中的最上層屬性。

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

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

model使用和來更新指定的實例 valueProvider prefix

public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ prefix, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider, Func<Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^, bool> ^ propertyFilter);
[Microsoft.AspNetCore.Mvc.NonAction]
public System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string prefix, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, Func<Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata,bool> propertyFilter) where TModel : class;
[<Microsoft.AspNetCore.Mvc.NonAction>]
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)
Public Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, prefix As String, valueProvider As IValueProvider, propertyFilter As Func(Of ModelMetadata, Boolean)) As Task(Of Boolean)

類型參數

TModel

模型物件的型別。

參數

model
TModel

要更新的模型執行個體。

prefix
String

在中查閱值時要使用的前置詞 valueProvider

valueProvider
IValueProvider

IValueProvider用於查閱值的。

propertyFilter
Func<ModelMetadata,Boolean>

可以用來在執行時間篩選屬性的述詞。

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於

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

model使用和來更新指定的實例 valueProvider prefix

public:
generic <typename TModel>
 where TModel : class System::Threading::Tasks::Task<bool> ^ TryUpdateModelAsync(TModel model, System::String ^ prefix, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider, ... cli::array <System::Linq::Expressions::Expression<Func<TModel, System::Object ^> ^> ^> ^ includeExpressions);
[Microsoft.AspNetCore.Mvc.NonAction]
public System.Threading.Tasks.Task<bool> TryUpdateModelAsync<TModel> (TModel model, string prefix, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, params System.Linq.Expressions.Expression<Func<TModel,object>>[] includeExpressions) where TModel : class;
[<Microsoft.AspNetCore.Mvc.NonAction>]
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)
Public Function TryUpdateModelAsync(Of TModel As Class) (model As TModel, prefix As String, valueProvider As IValueProvider, ParamArray includeExpressions As Expression(Of Func(Of TModel, Object))()) As Task(Of Boolean)

類型參數

TModel

模型物件的型別。

參數

model
TModel

要更新的模型執行個體。

prefix
String

在中查閱值時要使用的前置詞 valueProvider

valueProvider
IValueProvider

IValueProvider用於查閱值的。

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

Expression (s) ,代表需要包含在目前模型中的最上層屬性。

傳回

Task<Boolean>

Task當更新成功時,在完成時傳回true

屬性

適用於