Share via


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)

ModelError如果 IsBindingRequired ,請將 新增至 ModelState

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 執行個體。

適用於