ef core - how to make multiple variations of a class map to the same table

c# ef-code-first ef-core-2.1 entity-framework-core

Question

I have 5 satellite assemblies with their own db contexts. I created a 6th the assembly just for code first migration. The idea was to add the satellite assemblies as references then create migration for all models. The quirk with this setup is that some of the satellite assemblies have same classes but with more or less properties(depending on whether they make sense in their respective context).

When I create a migration I get: Cannot use table 'dbo.TableA' for entity type 'PartialClassA' since it is being used for entity type 'ClassA' and there is no relationship between their primary keys.

I hope what I am trying to do make sense, my question is how do we make this work with code first?

1
2
8/30/2018 2:26:19 AM

Popular Answer

For anyone interested, here is a response from the ef core github forum

1
8/30/2018 8:41:57 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow