CollectionModelBinder<TElement> Класс

Определение

IModelBinder реализация значений коллекции привязки.

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

Параметры типа

TElement

Тип элементов в коллекции.

Наследование
CollectionModelBinder<TElement>
Производный
Реализации

Конструкторы

CollectionModelBinder<TElement>(IModelBinder)
Устаревшие..

Этот конструктор устарел и будет удален в следующей версии. Рекомендуемая альтернатива — перегрузка, которая также принимает .ILoggerFactory

Создает новый экземпляр CollectionModelBinder<TElement>.

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory)

Создает новый экземпляр CollectionModelBinder<TElement>.

CollectionModelBinder<TElement>(IModelBinder, ILoggerFactory, Boolean)

Создает новый экземпляр CollectionModelBinder<TElement>.

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

Создает новый экземпляр CollectionModelBinder<TElement>.

Свойства

ElementBinder

IModelBinder Возвращает экземпляры для элементов коллекции привязки.

Logger

Объект , используемый ILogger для ведения журнала в этом связывающем объекте.

Методы

AddErrorIfBindingRequired(ModelBindingContext)

Добавьте в , ModelErrorModelState если IsBindingRequired.

BindModelAsync(ModelBindingContext)

Пытается привязать модель.

CanCreateInstance(Type)

Возвращает значение, указывающее, может ли эта ICollectionModelBinder реализация создать объект, назначаемый Object .targetType

ConvertToCollectionType(Type, IEnumerable<TElement>)

Получает назначаемый Object объект , targetType содержащий элементы из collection.

CopyToModel(Object, IEnumerable<TElement>)

Добавляет значения из sourceCollection в заданный target.

CreateEmptyCollection(Type)

Создайте назначаемый Object объект .targetType

CreateInstance(Type)

Создание экземпляра targetType.

Применяется к