Atributo Default (SSDL EntityType)

En el Entity Data Model (EDM), el atributo Default de una definición de Property especifica el valor que está asignado a la propiedad cuando se crea una instancia del tipo.

La definición siguiente de la entidad Department incluye cuatro elementos Property. Cada propiedad tiene un atributo Type que usa un tipo de datos asignado. Por ejemplo, la propiedad GroupName incluye la asignación Default "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>

Vea también

Conceptos

Atributo Default (CSDL EntityType)