CollectionModelBinder<TElement> 建構函式

定義

多載

CollectionModelBinder<TElement>(IModelBinder)
已淘汰.

此建構函式已經過時,將會在未來版本中移除。 建議的替代方法是也採用 的多 ILoggerFactory 載。

建立新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory)

建立新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

建立新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean, MvcOptions)

建立新的 CollectionModelBinder<TElement>

CollectionModelBinder<TElement>(IModelBinder)

警告

This constructor is obsolete and will be removed in a future version. The recommended alternative is the overload that also takes an ILoggerFactory.

此建構函式已經過時,將會在未來版本中移除。 建議的替代方法是也採用 的多 ILoggerFactory 載。

建立新的 CollectionModelBinder<TElement>

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder);
[System.Obsolete("This constructor is obsolete and will be removed in a future version. The recommended alternative is the overload that also takes an ILoggerFactory.")]
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
[<System.Obsolete("This constructor is obsolete and will be removed in a future version. The recommended alternative is the overload that also takes an ILoggerFactory.")>]
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder)

參數

elementBinder
IModelBinder

IModelBinder繫結項目的 。

屬性

適用於

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory)

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder, loggerFactory As ILoggerFactory)

參數

elementBinder
IModelBinder

用於 IModelBinder 系結 TElement 的 。

loggerFactory
ILoggerFactory

ILoggerFactory

備註

即使 IsBindingRequiredtrue ,系結器也不會為未系結的最上層模型新增錯誤。

適用於

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool allowValidatingTopLevelNodes);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory * bool -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder, loggerFactory As ILoggerFactory, allowValidatingTopLevelNodes As Boolean)

參數

elementBinder
IModelBinder

用於 IModelBinder 系結 TElement 的 。

loggerFactory
ILoggerFactory

ILoggerFactory

allowValidatingTopLevelNodes
Boolean

表示已啟用最上層模型的驗證。 如果 trueIsBindingRequiredtrue 是用於最上層模型,則系結器會在模型未系結時新增 ModelStateDictionary 錯誤。

適用於

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean, MvcOptions)

public:
 CollectionModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ elementBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool allowValidatingTopLevelNodes, Microsoft::AspNetCore::Mvc::MvcOptions ^ mvcOptions);
public CollectionModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder elementBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes, Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory * bool * Microsoft.AspNetCore.Mvc.MvcOptions -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<'Element>
Public Sub New (elementBinder As IModelBinder, loggerFactory As ILoggerFactory, allowValidatingTopLevelNodes As Boolean, mvcOptions As MvcOptions)

參數

elementBinder
IModelBinder

用於 IModelBinder 系結 TElement 的 。

loggerFactory
ILoggerFactory

ILoggerFactory

allowValidatingTopLevelNodes
Boolean

表示已啟用最上層模型的驗證。 如果 trueIsBindingRequiredtrue 是用於最上層模型,則系結器會在模型未系結時新增 ModelStateDictionary 錯誤。

mvcOptions
MvcOptions

MvcOptions

備註

這是慣用 CollectionModelBinder<TElement> 的建構函式。

適用於