Default Attribute (EntityType CSDL)

In the Entity Data Model (EDM), the Default attribute of a Property element specifies the value that is assigned to the property when an instance of the type is created.

The following definition of the Department entity includes four Property elements. Each property has a Type attribute that uses an assigned data type. For example, the GroupName property includes the Default assignment "New Hire".

  <EntityType Name="Department" >
    <Key>
        <PropertyRef Name="DepartmentID">
    </Key>
    <Property Name="DepartmentID" Type="Int16" Nullable="false" />
    <Property Name="Name" Type="String" Nullable="false" />
    <Property Name="GroupName" Type="String" Nullable="false" Default="New Hire" />
    <Property Name="ModifiedDate" Type="DateTime" Nullable="false" />
  </EntityType>

See Also

Concepts

Default Attribute (EntityType SSDL)