Default Attribute (EntityType SSDL)

Switch View :
ScriptFree
Default Attribute (EntityType SSDL)
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

In the Entity Data Model (EDM), the Default attribute of a Property definition 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" MaxLength="50" />
    <Property Name="GroupName" Type="String" Nullable="false"
                               Default="New Hire" MaxLength="50" />
    <Property Name="ModifiedDate" Type="DateTime" Nullable="false" />
  </EntityType>

See Also