Entity Framework (.NET) Circular modeling with the first model?

I am currently working on a project in which I want to use the Entity Framework for the first time. I read a lot in Lerman / Miller books, on MSDN, on the ADO.NET blog and here on stackoverflow about the latest developments regarding the DbContext API and the first code migrations available with EF 4.3. Since, in particular, the latter are really great, I wondered, can the same thing be done as the "First Model"? Is it possible to do migrations based on the visual designer EDMX (instead of code) after creating code and a database from it?

I found a fairly recent link (2012-04) that says it isn’t (in EF 4.3): Using the EF4 migration tool using the first model approach

Secondly, I found information that the old code tables and databases are overwritten when trying to regenerate them from the EDMX designer?

But the information I'm talking about is about Power Tools: http://blogs.msdn.com/b/adonet/archive/2012/04/09/ef-power-tools-beta-2-available.aspx

Engineer Reverse Code This command allows one-time creation of code mappings of the first code for an existing database. [..] • Running this command will overwrite several previously created files several times, including any changes made to the generated files.

Is this restriction specific only to the code of the power tool engineer-generator, or is it expanding to the EDMX designer as a whole, especially the First Model, too?

Also, in the above article, I found:

View Entity Data Model (read-only) Displays the Code First model in the Entity Framework Designer. • This view of the model is read-only; you cannot update the Code First model using the constructor.

And the same question applies here.

So, is there currently a way with full round-trip without data loss (code and database) and saving the EDMX file that is writable is preferable to the following “First Model”?

From which is supported verson of EF on (already or planned), which version of .NET should I aim then (4.0 is enough?), And it will work with Visual Studio 2010 Professional? Could you give a rough estimate of the date you can implement this?

This, of course, would be amazing and a huge breakthrough! I think that I can only roughly imagine how much work this will be, and I know that you are already fully working at your limit. I want to thank you for your excellent work and encourage you to support it.

+1
source share
1 answer

If I understand your question correctly, you are after Migrations for EF Designer (i.e. update the model in the designer and gradually change the database). This is not supported at the moment, but in our backlog we are turning, but we do not have specific plans for a specific version. One of the things we need to solve is whether it’s easy to integrate / expand the existing “Primary Link” function to work with EF Designer or whether we need something more designer-oriented. Obviously, everything can change, but at this stage I would not expect that we will begin work on this function over the next 6 months. Besides the fact that it will depend on what functions we see, people ask ... so I would create a new function at http://data.uservoice.com and ask people to vote on the topic. ~ Rawon

+2
source

Source: https://habr.com/ru/post/1270276/


All Articles