MetadataTypeAttribute(Type) Konstruktor

Definíció

Inicializálja a MetadataTypeAttribute osztály új példányát.

public:
 MetadataTypeAttribute(Type ^ metadataClassType);
public MetadataTypeAttribute(Type metadataClassType);
new System.ComponentModel.DataAnnotations.MetadataTypeAttribute : Type -> System.ComponentModel.DataAnnotations.MetadataTypeAttribute
Public Sub New (metadataClassType As Type)

Paraméterek

metadataClassType
Type

A hivatkozni kívánt metaadatosztály.

Kivételek

metadataClassType az null.

Példák

Az alábbi példa bemutatja, hogyan társíthat MetadataTypeAttribute metaadatosztályt egy entitás részleges osztályához.

[MetadataType(typeof(CustomerMetaData))]
public partial class Customer
{
}
<MetadataType(GetType(CustomerMetadata))> _
Partial Public Class Customer

End Class

A következőre érvényes: