Share via


ICollectionModelBinder.CanCreateInstance(Type) 方法

定义

获取指示此 ICollectionModelBinder 实现是否可以创建 Object 可分配给 的 targetType

public:
 bool CanCreateInstance(Type ^ targetType);
public bool CanCreateInstance (Type targetType);
abstract member CanCreateInstance : Type -> bool
Public Function CanCreateInstance (targetType As Type) As Boolean

参数

targetType
Type

Type 模型的 。

返回

true 如果此 ICollectionModelBinder 实现可以创建 ObjecttargetType分配给 的 ,则为 ; false 否则为 。

注解

true如果模型最初null为 ,则返回值对于成功进行模型绑定是必需的。

适用于