共用方式為


ModelAnnotation.RegisterPropertyClass<TProperty> 方法

向附註註冊屬性型別。

命名空間:  Microsoft.Data.Schema.SchemaModel
組件:  Microsoft.Data.Schema (在 Microsoft.Data.Schema.dll 中)

語法

'宣告
Protected Shared Function RegisterPropertyClass(Of TProperty) ( _
    annotationClass As ModelAnnotationClass, _
    propertyName As String, _
    defaultValue As TProperty _
) As ModelPropertyClass
protected static ModelPropertyClass RegisterPropertyClass<TProperty>(
    ModelAnnotationClass annotationClass,
    string propertyName,
    TProperty defaultValue
)
protected:
generic<typename TProperty>
static ModelPropertyClass^ RegisterPropertyClass(
    ModelAnnotationClass^ annotationClass, 
    String^ propertyName, 
    TProperty defaultValue
)
static member RegisterPropertyClass : 
        annotationClass:ModelAnnotationClass * 
        propertyName:string * 
        defaultValue:'TProperty -> ModelPropertyClass 
JScript 不支援泛型型別或方法。

型別參數

  • TProperty
    屬性值的 Type

參數

  • propertyName
    型別:System.String
    string ,包含屬性的名稱。
  • defaultValue
    型別:TProperty
    型別 TProperty 的物件,這個物件表示預設值。

傳回值

型別:Microsoft.Data.Schema.SchemaModel.ModelPropertyClass
已註冊之屬性的中繼資料物件。

.NET Framework 安全性

請參閱

參考

ModelAnnotation 類別

Microsoft.Data.Schema.SchemaModel 命名空間

ModelAnnotationClass