共用方式為


Entity Data Model Types

The Entity Data Model (EDM) provides the basic structure for schema declarations of entities. The EDM EntityType is the basic type defined by the EDM for a top-level application concept. Entities designed explicitly for application use are derived from the EDM EntityType.

The EDM defines entities in conceptual schema definition language (CSDL). The definitions provide type checking when using Entity SQL or strongly typed CLR languages. A strongly typed language has the following characteristics:

  • There is strict enforcement of type rules without exceptions.

  • All types are known at compile time.

  • Any type conversions are predictable in their effects.

The EDM type system is structure-based instead of behavior-based in three ways:

  • The EDM types are not encapsulated.

  • The EDM types do not have associated methods.

  • The EDM supports structural inheritance but not behavioral inheritance.

For information about implementing methods in partial classes, see Helper Methods (EDM).

Conceptual Schema Definition Language (CSDL)

CSDL is an XML syntax used to describe both the EDM types provided when the Entity Framework is installed and those designed by the developer. CSDL is similar to the subset of C# used for defining classes, and to the data definition language (DDL) subset of SQL. The CSDL syntax is expressed in XML but is not XSD-based.

The following topics describe schemas and the basic types defined in CSDL.

In This Section

  • Simple Types (EDM)
    Describes the primitive data types that are assigned as values of properties of entities and complex types.
  • Entity Type (EDM)
    Describes the basic distinctions in the core modeling capabilities provided by the EDM.

See Also

Concepts

Entity Data Model
Entity Data Model Relationships
Taxonomy of EDM Types

Other Resources

Schemas and Mapping Specification (Entity Framework)