This documentation is archived and is not being maintained.

Annotation Elements (SSDL)

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

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

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

  • Annotation elements must appear after all other child elements of a given SSDL element.

More than one annotation element may be a child of a given SSDL element. Starting with the .NET Framework version 4, 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 element (CustomElement). The example also shows an annotation attribute applied to the OrderId property.

<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