Appendix C. ADO.NET Entity Framework Walkthrough

If you’ve read Appendix B and are interested in building an ADO.NET Entity Framework Entity Data Model (EDM) on top of a database for use with ADO.NET Data Services, this appendix provides a quick walkthrough of those steps.

Creating the Data Model

The first step is to add a new item to your Visual Studio 2008 SP1 project. The Add New Item dialog box contains a template for an ADO.NET Data Model (see Figure C-1). Select this template to start the ADO.NET Entity Data Model Wizard (see Figure C-2).

ADO.NET EDM template
Figure C-1. ADO.NET EDM template
Page 1 of the Entity Data Model Wizard
Figure C-2. Page 1 of the Entity Data Model Wizard

The first page of the wizard asks whether you want to generate an EDM on top of a relational database or create an empty EDM that can be manually modeled and mapped to a data source. Select Generate from Database. On the next page, specify the connection string for the EDM generation, and whether you want the connection string saved into the project’s configuration file (see Figure C-3).

Entity Data Model Wizard connection string picker
Figure C-3. Entity Data Model Wizard connection string picker

After you select the connection string, the wizard moves on to a type picker page, where you can select the entities from ...

Get RESTful .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.