EF 6 Bug – Can’t share tables across edmx files?

I’m trying to upgrade an application from EF 4 to EF 6 and ran into a number of problems, so I spiked out a simple console app and am seeing the same bizarre behavior.

Using two different .edmx files, using different connection settings, and using custom namespaces, if I try to have each one reference the same two tables, so that they could have those mapped as entities in each namespace, it fails. 

If I run custom tool on the model .tt file one by one, I can see that it will ‘steal’ the entities back and forth, and obviously, when I try to build the solution as a whole, it will choose one of them (reverse alphabetical order?  not sure).

This can’t possibly be right.  Think of a stereotypical eCommerce app.  I will want to have cart entities in a ‘shopping around’ context as well as cart entities in a ‘checking out’ context.  They aren’t the same entities (though they ultimately map to the same tables).  I use earlier versions of Entity Framework to do this as expected.

This can’t possibly be right, I must be doing something horribly silly.

posted on Wednesday, June 04, 2014 4:06 PM Print
No comments posted yet.

Post Comment

Title *
Name *
Comment *  
Please add 6 and 2 and type the answer here: