views:

21

answers:

3

Hello,

I have a VS2008 web project with a EF1 datamodel. Now I have converted this to a VS2010 project with .Net 4. My question is about the Entity Framework. How can I see what version of EF it is. Or how can I make sure it is EF 4?

A: 

You can look in project references on the version of System.Data.Entity.dll.

Albin Sunnanbo
Thanks for the answer!
karl
A: 

Look at your 'System.Data.Entity' reference version, if it's 3.5.0.0, then it's EF1. If it's 4.0.0.0, then your using EF4.

Guilherme Oenning
Thanks for yor answer. So if I open a VS2008 project with VS2010 and this is converted with success (.Net 4 and System.Data.Entity is 4.0...) my data model is converted too? Or do I need to rebuild my nodel from the database?
karl
I'm not sure, but I don't think it'll convert automatic. Anyway, why don't you test it? Make a backup, go ahead and tells us the result. I think EF4 has backward compatibility with EF1.
Guilherme Oenning
A: 

There are really two questions here:

  1. What is the EF assembly version? In a (correct) .NET 4 project, it can really only be 4.
  2. What is your EF model version? Perhaps surprisingly, the EF 4 assemblies support both EF 1 and EF 4 models at runtime.

When you upgrade a VS 2008 project to .NET 4, it will upgrade the EDMX to an EF 4 model, as well. But if you skipped this or just want to confirm it's right, look at the xmlns elements in the EDMX.

  • For CSDL, EF 4 is "http://schemas.microsoft.com/ado/2008/09/edm"; EF 1 is "http://schemas.microsoft.com/ado/2006/04/edm".
  • For SSDL, EF 4 is "http://schemas.microsoft.com/ado/2009/02/edm/ssdl"; EF 1 is "http://schemas.microsoft.com/ado/2006/04/edm/ssdl"
  • For MSL, EF 4 is "http://schemas.microsoft.com/ado/2008/09/mapping/cs"; EF 1 is "urn:schemas-microsoft-com:windows:storage:mapping:CS"
Craig Stuntz
Thank you! In that case I can confirm my model is EF4.
karl