MetadataTypeAttribute(Type) 构造函数
定义
初始化 MetadataTypeAttribute 类的新实例。Initializes a new instance of the MetadataTypeAttribute class.
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
要引用的元数据类。The metadata class to reference.
例外
metadataClassType 为 null。metadataClassType is null.
示例
下面的示例演示如何使用将 MetadataTypeAttribute 元数据类与实体分部类相关联。The following example shows how to use the MetadataTypeAttribute to associate a metadata class with an entity partial class.
[MetadataType(typeof(CustomerMetaData))]
public partial class Customer
{
}
<MetadataType(GetType(CustomerMetadata))> _
Partial Public Class Customer
End Class