DictionaryModelBinder<TKey,TValue> 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder)
- Source:
- DictionaryModelBinder.cs
- Source:
- 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。
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
TKey
的 IModelBinder。
- valueBinder
- IModelBinder
TValue
的 IModelBinder。
- 属性
适用于
DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory)
- Source:
- DictionaryModelBinder.cs
- Source:
- DictionaryModelBinder.cs
- Source:
- 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
TKey
的 IModelBinder。
- valueBinder
- IModelBinder
TValue
的 IModelBinder。
- loggerFactory
- ILoggerFactory
注解
即使 IsBindingRequired 为 true
,绑定器也不会为未绑定的顶级模型添加错误。
适用于
DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory, Boolean)
- Source:
- DictionaryModelBinder.cs
- Source:
- 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
TKey
的 IModelBinder。
- valueBinder
- IModelBinder
TValue
的 IModelBinder。
- loggerFactory
- ILoggerFactory
- allowValidatingTopLevelNodes
- Boolean
指示已启用顶级模型的验证。 如果 true
和 IsBindingRequiredtrue
适用于顶级模型,则绑定器会在未绑定模型时添加错误 ModelStateDictionary 。
注解
参数 allowValidatingTopLevelNodes
当前被忽略。
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder`1.AllowValidatingTopLevelNodes 始终 false
位于 中 DictionaryModelBinder<TKey,TValue>。 此类忽略该属性,并使用 无条件地检查未绑定的顶级模型 IsBindingRequired。
适用于
DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder, ILoggerFactory, Boolean, MvcOptions)
- Source:
- 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
TKey
的 IModelBinder。
- valueBinder
- IModelBinder
TValue
的 IModelBinder。
- loggerFactory
- ILoggerFactory
- allowValidatingTopLevelNodes
- Boolean
指示已启用顶级模型的验证。 如果 true
和 IsBindingRequiredtrue
适用于顶级模型,则绑定器会在未绑定模型时添加错误 ModelStateDictionary 。
- mvcOptions
- MvcOptions
注解
这是首选 DictionaryModelBinder<TKey,TValue> 构造函数。
参数 allowValidatingTopLevelNodes
当前被忽略。
Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder`1.AllowValidatingTopLevelNodes 始终 false
位于 中 DictionaryModelBinder<TKey,TValue>。 此类忽略该属性,并使用 无条件地检查未绑定的顶级模型 IsBindingRequired。