共用方式為


DefaultModelBindingContext.CreateBindingContext 方法

定義

為最上層模型系結作業建立新的 DefaultModelBindingContext

public:
 static Microsoft::AspNetCore::Mvc::ModelBinding::ModelBindingContext ^ CreateBindingContext(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::IValueProvider ^ valueProvider, Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata, Microsoft::AspNetCore::Mvc::ModelBinding::BindingInfo ^ bindingInfo, System::String ^ modelName);
public static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext CreateBindingContext (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo bindingInfo, string modelName);
public static Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext CreateBindingContext (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider valueProvider, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo? bindingInfo, string modelName);
static member CreateBindingContext : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.IValueProvider * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * Microsoft.AspNetCore.Mvc.ModelBinding.BindingInfo * string -> Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext
Public Shared Function CreateBindingContext (actionContext As ActionContext, valueProvider As IValueProvider, metadata As ModelMetadata, bindingInfo As BindingInfo, modelName As String) As ModelBindingContext

參數

actionContext
ActionContext

ActionContext與系結作業相關聯的 。

valueProvider
IValueProvider

IValueProvider要用於系結的 。

metadata
ModelMetadata

ModelMetadata 與模型相關聯。

bindingInfo
BindingInfo

BindingInfo 與模型相關聯。

modelName
String

要系結的屬性或參數名稱。

傳回

DefaultModelBindingContext 的新執行個體。

適用於