Posts
12
Comments
10
Trackbacks
0
Tuesday, March 1, 2011
[EF + Oracle] Intro

Prologue

I have a busy personal and working time, and at this moment that I start to get more free time, I decided to start a Serie about Entity Framework with Oracle.

A few time ago, I got my first experience with EF and Oracle with Oracle 10 g express and Oracle 10 g with the same results, Doesn’t work.

Now I download Oracle 11 g to Test again.

Tools

To start using EF with Oracle we need the following:

1. Visual Studio 2010. No Express Edition

2. Oracle 11g

3 Oracle Driver for EF (ODAC)

Intro

People, who are starting with EF developments, I recommend to take a look into Unai Zorrilla’s Blog, the post were written in Spanish but they are great!

To this Serie, we are going to define the DB from the Oracle administrator. For that we need to follow the next steps:

1. Create a User with a PassWord. In my example the user will be Jtorrecilla

2. Create a TableSpace

3. Define some example tables

 

(Image1)

When we have created the DB, we are going to start a new project in VS 2010. I will start a C# Project.

To start with EF, we need to add a new objet to our Project “ADO .NET Entity Data Model".

(Image2)

The next step will be to indicate that our model will be based on an existing DB, and indicate the connection string (Images 3 and 4):

(Imagen3)

(Imagen4)

Once we selected the connection string, we will need to indicate that in the connection will be saved “Sensitive” data (Image 5), and in the next step we are going to select the DB objets to use in the project(Image 6).

 

(Image 5)

(Image 6)

At the end, we will press Finish button, and it will generate a EDMX file to add to our solution, and in the IDE will appear the DB Schema with the selected Tables and Relations.

(Imagen7)

One Entity is composed by a set of properties (each matches with a column from the Table in the DB) and Navigation Properties that represents any relation with other Entities.

 

Finally

With this chapter we have installed the environment, defined a DB and configured the solution to start using EF with Oracle.

In the next chapter we are going to see What is a Entity and how it works.

I hope you enjoy this Serie!

Posted On Tuesday, March 1, 2011 4:27 PM | Comments (6)