CollectionModelBinder<TElement>.ConvertToCollectionType 方法

定义

获取一个 ObjecttargetType 分配给的 ,其中包含 来自 collection的成员。

protected:
 virtual System::Object ^ ConvertToCollectionType(Type ^ targetType, System::Collections::Generic::IEnumerable<TElement> ^ collection);
protected virtual object ConvertToCollectionType (Type targetType, System.Collections.Generic.IEnumerable<TElement> collection);
protected virtual object? ConvertToCollectionType (Type targetType, System.Collections.Generic.IEnumerable<TElement?> collection);
abstract member ConvertToCollectionType : Type * seq<'Element> -> obj
override this.ConvertToCollectionType : Type * seq<'Element> -> obj
Protected Overridable Function ConvertToCollectionType (targetType As Type, collection As IEnumerable(Of TElement)) As Object

参数

targetType
Type

Type 模型的 。

collection
IEnumerable<TElement>

从值提供程序检索到的值的集合。 null 如果未绑定任何内容,则为 。

返回

ObjecttargetType分配给 的 。 null 如果未绑定任何内容,则为 。

注解

允许在从绑定器返回之前操作或转换绑定集合的扩展点。

适用于