Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the VS Entity Data Model Designer be configured to use a newer version of the EF?

Can the designer surface in VS2010 be configured for example to use EF 4.3, perhaps?

I think by default it supports 4.0 but what If you use a nuget package to get 4.3? I might be getting my wires crossed with the Code First approach but still I am very happy with the Data Model the designer and have no need to go for a CF approach on this project maybe for future projects.

Is there a default traditional approach i.e if you want to use the designer in vs2010 then you are stuck with EF 4.0, if you want to use the latest and greatest, you have to learn the CF approach?

MSDN - Entity Data Model Designer, .Net 4.0

StackOverFlow similar question

UPDATE:

http://blogs.microsoft.co.il/blogs/gilf/archive/2010/12/08/ef-feature-ctp5-walkthrough-for-the-new-dbcontext-t4-template.aspx

Still could do with some more clarity and an expert oppinion on this.

like image 755
IbrarMumtaz Avatar asked Dec 04 '25 16:12

IbrarMumtaz


1 Answers

You can certainly use EF 4.3 with the EF Designer. What this means is using the DbContext API with a Database First or Model First approach, rather than a Code First approach. To do this you need to download the DbContext T4 templates so that the Designer will generate EF 4.3 code instead of EF 4.0 code. This walkthrough was written for EF 4.1 but still applies for 4.3: http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-model-amp-database-first-walkthrough.aspx

Note that using EF 4.3 means using the DbContext APIs. However, this is not the same as using Code First--you can still use the designer with DbContext. That being said, if you want to keep using ObjectContext and not DbContext then there is no value in using 4.3--it doesn't add anything to ObjectContext.

I would stronly encourage people to start using the DbContext APIs regardless of whether they are doing Code First, Database First, or Model First.

like image 102
Arthur Vickers Avatar answered Dec 06 '25 06:12

Arthur Vickers



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!