Note: To use the ADO.NET Entity Framework you are going to need Visual Studio 2008 + SP1

What is it?

Basically it allows you to create a model of your database and map objects to relational data (classes).  It marries classes to tables.  Using LINQ you can easily query the classes auto generated by the model.

Quick Sample

Step #1

Add New Item to your project “ADO.NET Entity Data Model ” (generates edmx file)

addnewitem.jpg

Step #2

Follow Entity Data Model Wizard
wizard1.jpg

wizard2.jpg

wizard3.jpg

Step #3

A new model is generated with the tables you selected in the wizard.  Also new classes are generated which you can query from LINQ

visualstudio.jpg

Look at the mapping Details tab, where you can see how the table fields aer mapped to a class.

Here is a simple sample of how to query the class auto generated:

visualstudio1.jpg

Tags: , ,

One Response to “ADO.NET Entity Framework 101”

  1. This seems really useful, I’ll have to check it out. Thanks for posting.

RSS
Copyright © 2010 Islander’s Analog life…. All rights reserved. Amazing Grace theme by Vladimir Prelovac.