3 Using Your Data Provider with the ADO.NET Entity Framework : Using Model First

Using Model First
NOTE: Developing using the Model First model requires that you are using Microsoft .NET Framework Version 4.0 or higher, and Visual Studio 2010 or higher with the DataDirect Connect for ADO.NET Version 4.0 ADO.NET Oracle Entity Framework data providers.
The following procedure uses the Oracle ADO.NET Entity Framework data provider, and assumes that you already have the database schema available.
1
2
New project, with the solution selected in Solution Explorer
3
Menus for adding an Entity Data Model to a project are shown
4
Select ADO.NET EntityDataModel, and then click Add. The Entity Data Model Wizard is displayed.
Designing the database mode. The Empty model option is selected.
5
Select Empty Model, and then click Finish. An empty model is added to your application.
6
Right-click the empty model and select Properties / DDL Generation Template. Click the drop-down menu and set the value to DataDirect SSDLToOracle.tt (VS).
Selecting the DDL Generation Template in the Properties pane
7
Designing the database model
8
When you are satisfied with the model design, right-click the model and select Generate database from model. The Generate Database wizard is displayed.
9
On the Choose Your Data Connection window, do the following steps:
a
Click New Connection to create a new connection.
b
c
Click Next. The DDL is generated.
10
Click Finish. SQL is added to your application.
Summary of settings in the Generate Database Wizard
11
Copying the DDL
After executing the DDL, the backend database is ready for use, with all of the database objects mapped to your model.
Completed database with the database objects mapped to your model