Condividi tramite


Attributo Default (EntityType SSDL)

In Entity Data Model (EDM) l'attributo Default di una definizione di Property specifica il valore assegnato alla proprietà quando viene creata un'istanza del tipo.

La definizione seguente dell'entità Department include quattro elementi Property. Ogni proprietà dispone di un attributo Type che utilizza un tipo di dati assegnato. La proprietà GroupName include, ad esempio, l'assegnazione 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>

Vedere anche

Concetti

Attributo Default (EntityType CSDL)