Entity Framework - Model First - Storage / Conceptual Associations RRS feed

  • Question

  • I've got a Entity Framework model, which I use to generate a SQL CE 4 database SDF file as required.

    Within the Storage Model schema of my EF, is there any point in defining all the entity associations (roles, referential constraints, etc)? Obviously including or not including them affects the output SDF file.

    I ask because the Conceptual Model associations seem to work seperately, and function no problem with or without the Storage Model associations present in the database.

    So I wonder is there any benefit in having the Storage Model associations at all? Would performance be a factor? Anything else?

    • Moved by ErikEJMVP Monday, February 21, 2011 8:18 PM (From:SQL Server Compact)
    Monday, February 21, 2011 3:42 PM

All replies

  • Hello rizzlwizzl,


    Welcome to the MSDN Forum and thank sfor posting here.

    AS I know, the Entity Framework  uses a conceptual model to provide an object-centric view of data, expressed as entity types and associations. An application developer only has to think about programming against the classes that are generated from the conceptual model, rather than having to also think about the store schema and how to access objects in the data store and transform them into programming objects. The Entity Framework uses a conceptual model, storage model, and mapping between these models to transform create, read, update, and delete operations against entities into equivalent operations in the data source.

    The conceptual model for an application expresses entities and relationships in conceptual schema definition language (CSDL), which is an implementation of the Entity Data Model. CSDL is an XML-based language. Entity types defined in CSDL each have a name, a key for uniquely identifying instances, and a set of properties. The data types assigned to properties are specified as either simple types, which are scalar properties, or as complex types, which are types that consist of one or more scalar or complex properties. XML attributes may also specify nullability or assign a default value. Associations define the relationships between entities. Entity Framework language elements and terminology are explained in more detail in Entity Framework Terminology.

    The storage model is described with store schema definition language (SSDL). The data types of properties declared in SSDL are those of the storage model.

    A mapping specification uses mapping specification language (MSL) to map the conceptual model to the storage model.

    More infomation, please see this:


    I hope this can help you.


    Have a nice day,

    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Jackie-Sun Wednesday, March 2, 2011 8:27 AM
    Tuesday, February 22, 2011 5:53 AM