Export (0) Print
Expand All

MetadataTypeAttribute Constructor

Initializes a new instance of the MetadataTypeAttribute class.

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

public MetadataTypeAttribute(
	Type metadataClassType
)

Parameters

metadataClassType
Type: System.Type

The metadata class to reference.

ExceptionCondition
ArgumentNullException

metadataClassType is null.

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
{


}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5 SP1

.NET Framework Client Profile

Supported in: 4
Show:
© 2015 Microsoft