CollectionModelBinder<TElement> 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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 載。
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
備註
即使 IsBindingRequired 是 true
,系結器也不會為未系結的最上層模型新增錯誤。
適用於
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
- allowValidatingTopLevelNodes
- Boolean
表示已啟用最上層模型的驗證。 如果 true
和 IsBindingRequiredtrue
是用於最上層模型,則系結器會在模型未系結時新增 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
- allowValidatingTopLevelNodes
- Boolean
表示已啟用最上層模型的驗證。 如果 true
和 IsBindingRequiredtrue
是用於最上層模型,則系結器會在模型未系結時新增 ModelStateDictionary 錯誤。
- mvcOptions
- MvcOptions
備註
這是慣用 CollectionModelBinder<TElement> 的建構函式。