Home > Sample chapters > Programming > Visual Studio and .NET

Getting to Know the Entity Framework

Chapter 1 quick reference

To

Do this

See how the application views the database

Open the .CSDL or .EDMX file and view its content.

See how the database manager views the database

Open the .SSDL or .EDMX file and view its content.

Determine how the Entity Framework resolves differences between the application view and the database manager view of the database

Open the .MSL or .EDMX file and view its content.

Create a new conceptual model

Click Add New Data Source in the Data Source window and choose Empty Model when prompted.

Add entities to the new conceptual model

Drag and drop an Entity object from the Entry Framework folder of the toolbox to the Entity Data Model Designer.

Generate a physical database based on your design

Right-click the entity you want to work with and choose Generate Database From Model on the context menu.

Generate the tables and other elements in your model

Choose SQL | Transact-SQL Editor | Execute.

Use the new database in an application

Create a reference to the model container, such as Model1Container ThisContainer = new Model1Container();, where Model1 is the name of the model you want to use.