This documentation is archived and is not being maintained.

Annotation Attributesv

Annotation attributes in store schema definition language (SSDL) are custom XML attributes in the storage model that provide extra metadata about the elements in the storage model. In addition to having valid XML structure, the following constraints apply to annotation attributes:

  • Annotation attributes must not be in any XML namespace that is reserved for SSDL.

  • The fully-qualified names of any two annotation attributes must not be the same.

More than one annotation attribute may be applied to a given SSDL element. Metadata contained in annotation elements can be accessed at runtime by using classes in the System.Data.Metadata.Edm namespace.


The following example shows an EntityType element that has an annotation attribute applied to the OrderId property. The example also show an annotation element added to the EntityType element.

<EntityType Name="Orders" xmlns:c="http://CustomNamespace">
    <PropertyRef Name="OrderId" />
  <Property Name="OrderId" Type="int" Nullable="false" 
  <Property Name="ProductId" Type="int" Nullable="false" />
  <Property Name="Quantity" Type="int" Nullable="false" />
  <Property Name="CustomerId" Type="int" Nullable="false" />
    Custom data here.

See Also