MetadataTypeAttribute(Type) 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 MetadataTypeAttribute 類別的新執行個體。
public:
MetadataTypeAttribute(Type ^ metadataClassType);
public MetadataTypeAttribute(Type metadataClassType);
new System.ComponentModel.DataAnnotations.MetadataTypeAttribute : Type -> System.ComponentModel.DataAnnotations.MetadataTypeAttribute
Public Sub New (metadataClassType As Type)
參數
- metadataClassType
- Type
要參考的元資料類別。
例外狀況
metadataClassType 是 null。
範例
以下範例展示如何利用 將 MetadataTypeAttribute 元資料類別與實體部分類別關聯。
[MetadataType(typeof(CustomerMetaData))]
public partial class Customer
{
}
<MetadataType(GetType(CustomerMetadata))> _
Partial Public Class Customer
End Class