Share via


CollectionModelBinder<TElement> Třída

Definice

IModelBinder implementace pro hodnoty kolekce vazeb.

generic <typename TElement>
public ref class CollectionModelBinder : Microsoft::AspNetCore::Mvc::ModelBinding::ICollectionModelBinder, Microsoft::AspNetCore::Mvc::ModelBinding::IModelBinder
public class CollectionModelBinder<TElement> : Microsoft.AspNetCore.Mvc.ModelBinding.ICollectionModelBinder, Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder
type CollectionModelBinder<'Element> = class
    interface ICollectionModelBinder
    interface IModelBinder
Public Class CollectionModelBinder(Of TElement)
Implements ICollectionModelBinder, IModelBinder

Parametry typu

TElement

Typ prvků v kolekci.

Dědičnost
CollectionModelBinder<TElement>
Odvozené
Implementuje

Konstruktory

CollectionModelBinder<TElement>(IModelBinder)
Zastaralé.

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

Vytvoří nový objekt CollectionModelBinder<TElement>.

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory)

Vytvoří nový objekt CollectionModelBinder<TElement>.

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

Vytvoří nový objekt CollectionModelBinder<TElement>.

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean, MvcOptions)

Vytvoří nový objekt CollectionModelBinder<TElement>.

Vlastnosti

ElementBinder

IModelBinder Získá instance pro vazby prvky kolekce.

Logger

Používá se ILogger pro protokolování v tomto pořadače.

Metody

AddErrorIfBindingRequired(ModelBindingContext)

Přidejte do , ModelErrorModelState pokud IsBindingRequired.

BindModelAsync(ModelBindingContext)

Pokusí se vytvořit vazbu modelu.

CanCreateInstance(Type)

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

ConvertToCollectionType(Type, IEnumerable<TElement>)

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

CopyToModel(Object, IEnumerable<TElement>)

Sečte hodnoty z sourceCollection do zadané targethodnoty .

CreateEmptyCollection(Type)

Object Vytvořte přiřaditelnou k targetType.

CreateInstance(Type)

Vytvořte instanci targetType.

Platí pro