DictionaryModelBinder<TKey,TValue> Třída

Definice

IModelBinder implementace pro hodnoty slovníku vazeb.

generic <typename TKey, typename TValue>
public ref class DictionaryModelBinder : Microsoft::AspNetCore::Mvc::ModelBinding::Binders::CollectionModelBinder<System::Collections::Generic::KeyValuePair<TKey, TValue>>
public class DictionaryModelBinder<TKey,TValue> : Microsoft.AspNetCore.Mvc.ModelBinding.Binders.CollectionModelBinder<System.Collections.Generic.KeyValuePair<TKey,TValue>>
type DictionaryModelBinder<'Key, 'Value> = class
    inherit CollectionModelBinder<KeyValuePair<'Key, 'Value>>
Public Class DictionaryModelBinder(Of TKey, TValue)
Inherits CollectionModelBinder(Of KeyValuePair(Of TKey, TValue))

Parametry typu

TKey

Typ klíčů ve slovníku

TValue

Typ hodnot ve slovníku

Dědičnost
DictionaryModelBinder<TKey,TValue>

Konstruktory

DictionaryModelBinder<TKey,TValue>(IModelBinder, IModelBinder)
Zastaralé.

Tento konstruktor je zastaralý a bude odebrán v budoucí verzi. Doporučená alternativa je přetížení, které také přebírá ILoggerFactory.

Vytvoří nový objekt DictionaryModelBinder<TKey,TValue>.

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

Vytvoří nový objekt DictionaryModelBinder<TKey,TValue>.

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

Vytvoří nový objekt DictionaryModelBinder<TKey,TValue>.

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

Vytvoří nový objekt DictionaryModelBinder<TKey,TValue>.

Vlastnosti

ElementBinder

IModelBinder Získá instance pro prvky kolekce vazeb.

(Zděděno od CollectionModelBinder<TElement>)
Logger

Používá se ILogger k protokolování v tomto pořadači.

(Zděděno od CollectionModelBinder<TElement>)

Metody

AddErrorIfBindingRequired(ModelBindingContext)

ModelError Přidat do ModelState pole if IsBindingRequired.

(Zděděno od CollectionModelBinder<TElement>)
BindModelAsync(ModelBindingContext)

Pokusí se vytvořit vazbu modelu.

CanCreateInstance(Type)

Získá označení, zda tato ICollectionModelBinder implementace může vytvořit Object přiřaditelné k targetType.

ConvertToCollectionType(Type, IEnumerable<KeyValuePair<TKey,TValue>>) System.Object.ConvertToCollectionType(System.Type,System.Collections.Generic.IEnumerable{System.Collections.Generic.KeyValuePair{`0,`1}})
ConvertToCollectionType(Type, IEnumerable<TElement>)

Object Získá přiřaditelné k targetType tomu, který obsahuje členy z collection.

(Zděděno od CollectionModelBinder<TElement>)
CopyToModel(Object, IEnumerable<TElement>)

Přidá hodnoty z sourceCollection daného .target

(Zděděno od CollectionModelBinder<TElement>)
CreateEmptyCollection(Type)

Vytvoření přiřaditelného objektu Object targetType.

CreateInstance(Type)

Vytvořte instanci targetType.

(Zděděno od CollectionModelBinder<TElement>)

Platí pro