Prevent EDMX Merge Conflicts and Cherry Choice Issues

I am using Entity Framework as my ORM and I am trying to figure out how to solve some of the main problems that I am facing. Let me describe the setup of my command for some background.

We use SQL Server 2012 for our database, Visual Studio 2012 for our development environment, GIT for our source control, and Entity Framework for our ORM. In our initial control, we are developing in an industry called the β€œmaster.” We have an "intermediate" branch (used for testing) and a "live" branch (this is the production code). When we make the correction, we turn off the last code in real time, push it to testing, and then push it to work when it is allowed to enter production. After that, we will merge the patch branch back into the main branch. We also had situations when the code that is currently in our main branch receives a cherry selected in the correction branch and live.

In all these cases, our main sore point is the EDMX file. The thing is huge with hundreds of table and proc mappings. Now we are in the view that only one developer can use the EDMX file at a time, because GIT cannot handle merge conflicts. Also, in the days when we tried to pick cherries from our live branch live, we are ending the EDMX merge nightmare.

We simply cannot continue this path, and of course we cannot hire more programmers until we gain control of our ORM. I am now where I plan to use a new ORM, such as ORMlite, so that I can get rid of the EDMX file. Does anyone have any experience with this? What can be done to prevent these merge conflicts and branching problems? I heard rumors that in EF6 the EDMX file will be deleted. It's true?

+6
source share
1 answer

We had the same problem in our midst. One solution that looks promising, first goes to the Entity Framework Code (in which you write code that generates your database schema) instead of using an EDMX file (in which code is generated from the database schema). One of the big advantages is that you have full control over POCOs and don't get a bunch of dirty generated code. This merge is similar to the merger of regular C # classes and does not cause the same headache as the EDMX merge.

Here is a tool that first converts an existing EDMX implementation to code: http://visualstudiogallery.msdn.microsoft.com/da740968-02f9-42a9-9ee4-1a9a06d896a2

Here is a good summary of the different approaches to EF, with the benefits of each of the following: https://www.simple-talk.com/dotnet/.net-framework/different-approaches-of-entity-framework/

Update: Here is another method that simplifies the headaches of EDMX merging: delete the contents of the <Diagrams> XML node. More details here: http://blogs.teamb.com/craigstuntz/2010/02/03/38542

0
source

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


All Articles