MetadataTypeAttribute(Type) Konstruktor

Definition

Initialisiert eine neue Instanz der MetadataTypeAttribute-Klasse.

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

Parameter

metadataClassType
Type

Die Metadatenklasse für den Verweis.

Ausnahmen

metadataClassType ist null.

Beispiele

Im folgenden Beispiel wird gezeigt, wie Sie eine MetadataTypeAttribute Metadatenklasse einer entitätsteiliellen Klasse zuordnen.

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

End Class

Gilt für: