Partilhar via


DictionaryModelBinder<TKey,TValue> Construtores

Definição

Sobrecargas

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder)
Obsoleto.

Esse construtor está obsoleto e será removido em uma versão futura. A alternativa recomendada é a sobrecarga que também usa um ILoggerFactory.

Cria um novo DictionaryModelBinder<TKey,TValue>.

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

Cria um novo DictionaryModelBinder<TKey,TValue>.

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

Cria um novo DictionaryModelBinder<TKey,TValue>.

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

Cria um novo DictionaryModelBinder<TKey,TValue>.

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder)

Origem:
DictionaryModelBinder.cs
Origem:
DictionaryModelBinder.cs

Cuidado

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

Esse construtor está obsoleto e será removido em uma versão futura. A alternativa recomendada é a sobrecarga que também usa um ILoggerFactory.

Cria um novo 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)

Parâmetros

keyBinder
IModelBinder

O IModelBinder para TKey.

valueBinder
IModelBinder

O IModelBinder para TValue.

Atributos

Aplica-se a

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

Origem:
DictionaryModelBinder.cs
Origem:
DictionaryModelBinder.cs
Origem:
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)

Parâmetros

keyBinder
IModelBinder

O IModelBinder para TKey.

valueBinder
IModelBinder

O IModelBinder para TValue.

loggerFactory
ILoggerFactory

O ILoggerFactory.

Comentários

O associador não adicionará um erro para um modelo de nível superior não associado, mesmo que IsBindingRequired seja true.

Aplica-se a

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

Origem:
DictionaryModelBinder.cs
Origem:
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)

Parâmetros

keyBinder
IModelBinder

O IModelBinder para TKey.

valueBinder
IModelBinder

O IModelBinder para TValue.

loggerFactory
ILoggerFactory

O ILoggerFactory.

allowValidatingTopLevelNodes
Boolean

Indicação de que a validação de modelos de nível superior está habilitada. Se true e IsBindingRequired for true para um modelo de nível superior, o associador adicionará um ModelStateDictionary erro quando o modelo não estiver associado.

Comentários

No momento, o allowValidatingTopLevelNodes parâmetro é ignorado. Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder`1.AllowValidatingTopLevelNodes está sempre false em DictionaryModelBinder<TKey,TValue>. Essa classe ignora essa propriedade e verifica incondicionalmente modelos de nível superior não associados com IsBindingRequired.

Aplica-se a

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

Origem:
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)

Parâmetros

keyBinder
IModelBinder

O IModelBinder para TKey.

valueBinder
IModelBinder

O IModelBinder para TValue.

loggerFactory
ILoggerFactory

O ILoggerFactory.

allowValidatingTopLevelNodes
Boolean

Indicação de que a validação de modelos de nível superior está habilitada. Se true e IsBindingRequired for true para um modelo de nível superior, o associador adicionará um ModelStateDictionary erro quando o modelo não estiver associado.

mvcOptions
MvcOptions

O MvcOptions.

Comentários

Esse é o construtor preferencial DictionaryModelBinder<TKey,TValue> .

No momento, o allowValidatingTopLevelNodes parâmetro é ignorado. Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder`1.AllowValidatingTopLevelNodes está sempre false em DictionaryModelBinder<TKey,TValue>. Essa classe ignora essa propriedade e verifica incondicionalmente modelos de nível superior não associados com IsBindingRequired.

Aplica-se a