共用方式為


DictionaryModelBinder<TKey,TValue> 建構函式

定義

多載

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder)
已淘汰.

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

建立新的 DictionaryModelBinder<TKey,TValue>

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory)

建立新的 DictionaryModelBinder<TKey,TValue>

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory, Boolean)

建立新的 DictionaryModelBinder<TKey,TValue>

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory, Boolean, MvcOptions)

建立新的 DictionaryModelBinder<TKey,TValue>

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder)

來源:
DictionaryModelBinder.cs
來源:
DictionaryModelBinder.cs

警告

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

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

建立新的 DictionaryModelBinder<TKey,TValue>

public:
 DictionaryModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ keyBinder, Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ valueBinder);
public DictionaryModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder keyBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder valueBinder);
[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 DictionaryModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder keyBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder valueBinder);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value>
[<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.DictionaryModelBinder<'Key, 'Value> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value>
Public Sub New (keyBinder As IModelBinder, valueBinder As IModelBinder)

參數

keyBinder
IModelBinder

TKeyIModelBinder

valueBinder
IModelBinder

TValueIModelBinder

屬性

適用於

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory)

來源:
DictionaryModelBinder.cs
來源:
DictionaryModelBinder.cs
來源:
DictionaryModelBinder.cs
public:
 DictionaryModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ keyBinder, Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ valueBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory);
public DictionaryModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder keyBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder valueBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value>
Public Sub New (keyBinder As IModelBinder, valueBinder As IModelBinder, loggerFactory As ILoggerFactory)

參數

keyBinder
IModelBinder

TKeyIModelBinder

valueBinder
IModelBinder

TValueIModelBinder

loggerFactory
ILoggerFactory

ILoggerFactory

備註

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

適用於

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory, Boolean)

來源:
DictionaryModelBinder.cs
來源:
DictionaryModelBinder.cs
public:
 DictionaryModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ keyBinder, Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ valueBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool allowValidatingTopLevelNodes);
public DictionaryModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder keyBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder valueBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory * bool -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value>
Public Sub New (keyBinder As IModelBinder, valueBinder As IModelBinder, loggerFactory As ILoggerFactory, allowValidatingTopLevelNodes As Boolean)

參數

keyBinder
IModelBinder

TKeyIModelBinder

valueBinder
IModelBinder

TValueIModelBinder

loggerFactory
ILoggerFactory

ILoggerFactory

allowValidatingTopLevelNodes
Boolean

指出已啟用最上層模型的驗證。 如果 trueIsBindingRequired 適用于 true 最上層模型,系結器會在模型未系結時新增 ModelStateDictionary 錯誤。

備註

參數 allowValidatingTopLevelNodes 目前會被忽略。 Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder`1.AllowValidatingTopLevelNodes 一律 false 在 中 DictionaryModelBinder<TKey,TValue> 。 這個類別會忽略該屬性,並以 無條件地檢查未系結的最上層模型 IsBindingRequired

適用於

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory, Boolean, MvcOptions)

來源:
DictionaryModelBinder.cs
public:
 DictionaryModelBinder(Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ keyBinder, Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder ^ valueBinder, Microsoft::Extensions::Logging::ILoggerFactory ^ loggerFactory, bool allowValidatingTopLevelNodes, Microsoft::AspNetCore::Mvc::MvcOptions ^ mvcOptions);
public DictionaryModelBinder (Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder keyBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder valueBinder, Microsoft.Extensions.Logging.ILoggerFactory loggerFactory, bool allowValidatingTopLevelNodes, Microsoft.AspNetCore.Mvc.MvcOptions mvcOptions);
new Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value> : Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder * Microsoft.Extensions.Logging.ILoggerFactory * bool * Microsoft.AspNetCore.Mvc.MvcOptions -> Microsoft.AspNetCore.Mvc.ModelBinding.Binders.DictionaryModelBinder<'Key, 'Value>
Public Sub New (keyBinder As IModelBinder, valueBinder As IModelBinder, loggerFactory As ILoggerFactory, allowValidatingTopLevelNodes As Boolean, mvcOptions As MvcOptions)

參數

keyBinder
IModelBinder

TKeyIModelBinder

valueBinder
IModelBinder

TValueIModelBinder

loggerFactory
ILoggerFactory

ILoggerFactory

allowValidatingTopLevelNodes
Boolean

指出已啟用最上層模型的驗證。 如果 trueIsBindingRequired 適用于 true 最上層模型,系結器會在模型未系結時新增 ModelStateDictionary 錯誤。

mvcOptions
MvcOptions

MvcOptions

備註

這是慣用 DictionaryModelBinder<TKey,TValue> 的建構函式。

參數 allowValidatingTopLevelNodes 目前會被忽略。 Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder`1.AllowValidatingTopLevelNodes 一律 false 在 中 DictionaryModelBinder<TKey,TValue> 。 這個類別會忽略該屬性,並以 無條件地檢查未系結的最上層模型 IsBindingRequired

適用於