Entity Framework Goodness

I finally got around to the Entity Framework BETA 2, and I like it already. To play with this, you need these bits;

Entity Framework Beta 2:

Tools, Aug 2007 CTP:

There is also a nice "Getting Started" piece on codeplex:

Getting Started:

I decided to brave it and just roll a quickie on my own from the Northwind database. All you do is Add New Item / ADO.NET Entity Data Model, which gives you a wizard to choose what database objects you want modeled, and then you get a nice class diagram:


All your entity model code is built for you. So to say, get 10 products from the Products table via a nice little LINQ query:

// Get 10 products via Entity LINQ query
using (NorthwindModel.NorthwindEntities1 ent = new NorthwindEntities1())
Products[] prod = (NorthwindModel.Products[])
(from pr in ent.Products select pr).Take(10).ToArray();
GridView1.DataSource = prod;

LINQ is extremely cool. As with any new technology, there is quite a learning curve, but it's really worth the effort. You can get into all kinds of complex LINQ queries and joins, the vocabulary and the syntax, especially combined with Lambda expressions, is outstanding. I've been working out of the Albaharis' book from O'Reilly, "C# 3.0 in a Nutshell", which has extensive reference-book type material on LINQ. They also have a free downloadable "LINQPAD" executable which i highly recommend.

Oh, and just for the sake of being concise: this is for Visual Studio 2008 - Orcas, NOT Visual Studio 2005.



  1. Anonymous11:17 AM

    You can download LINQpad here...


  2. Anonymous8:33 AM

    I use your rss feeds on the igoogle. For the last two days, clicking on your link is taking me to a ad website with no time out or other alternate link on that ad page which can further lead me to the original link at your site??? (ad page starts with pheedo......) is that something you are doing purposely? I feel hijacked!!

  3. I often experiment with ads and other features on my UnBlog. The correct feed url is now

    --which serves the feed along with a small number of Pheedo ads.

    You will also find this url in the autodiscovery link rel tag, as well as the feed icon at the right top of the page.


Post a Comment

Popular posts from this blog

ASP.NET: Loss of Session / Cookies with Frames

FIREFOX / IE Word-Wrap, Word-Break, TABLES FIX