Introducing the ADO.NET Entity Framework

For those of you who subscribe to VSJ, UK software journal, this month in the May edition hopefully you read my Introduction ADO.net Entity Framework article. It is a huge framework and the aim of my article was to demystify some of the terms and how they all link together, I feel it archives this aim.

For those of you who don’t subscribe, you can find the article online at http://www.vsj.co.uk/articles/display.asp?id=720.

Technorati Tags:

Entity Framework Tools – Refreshing model with schema changes

image One of the main problems with Linq to SQL was the fact that you couldn’t easily refresh your diagram to take into account schema changes.

I was really pleased to see that in the Entity Framework tools they have the ability to update model from database.  Simply right click the NorthwindModel.Store in the Model Browser and click the option to update.

You then have the ability to Add, Update or Delete items from your model.

image

However, not all is same it seems….

I created a model with all the tables from my database. I then later went back and removed all the entities apart from Customer, Order and Order_Details. After selecting to update my model, I unticked the Add checkbox as I didn’t want anything being added.  I then wanted to uncheck the other tables which I wasn’t interested in but got the error “Items for update and delete cannot be checked or unchecked”, this was a bit odd but fair enough.

So I clicked finish and it added all of the removed entities back into my model!  Not what I expected to happen at all.

To make matters worse, the column I dropped was still in my table! I tried to add a column and that didn’t appear either until I deleted and re-added the table.

Anyone have any ideas on the expected behaviour of this feature??

Entity Framework – New model wizard closes when generating from database

Tonight I was taking an in-depth look at the Entity Framework bits.  After creating my C# console application, I went to add the new ADO.NET Entity Data Model. After adding the item, I selected that the model should contain objects generated from database.  After clicking next, the dialog closes – not great!

Next step was to generate the model manually, however this also gave me a type initialise exception,  finally after closing VS2008 it crashed and gave Vista’s lovely error reporting messages.

The solution was a quick reinstall of the Entity Framework Tools CTP 2 soon shorted it out, it either didn’t install correctly or I didn’t install it (which is strange as I had the templates installed inside VS). 

ADO.NET Entity Framework Beta 2 & August Tools CTP

Mike Taulty has been busy and just posted loads of information on the ADO.Net Entity Framework (One of the joys of working for Microsoft – early access!). Really recommend you head over to his blog and check it out.

To get started, the following links are useful. 

Readme

http://download.microsoft.com/download/d/0/8/d0838c32-33cc-41fc-b839-50a2db658397/Readme.htm

Runtime

http://www.microsoft.com/downloads/details.aspx?FamilyID=F1ADC5D1-A42E-40A6-A68C-A42EE11186F7&displaylang=en

Tools

http://www.microsoft.com/downloads/details.aspx?FamilyID=09A36081-5ED1-4648-B995-6239D0B77CB5&displaylang=en

Getting Started Video

http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/archive/2007/08/27/9604.aspx

I haven’t had chance to look into this yet so expect more posts over the next few days and weeks.

Technorati Tags: