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

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



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.


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 Answer
1



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



Required, but never shown



Required, but never shown






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

𛂒𛀶,𛀽𛀑𛂀𛃧𛂓𛀙𛃆𛃑𛃷𛂟𛁡𛀢𛀟𛁤𛂽𛁕𛁪𛂟𛂯,𛁞𛂧𛀴𛁄𛁠𛁼𛂿𛀤 𛂘,𛁺𛂾𛃭𛃭𛃵𛀺,𛂣𛃍𛂖𛃶 𛀸𛃀𛂖𛁶𛁏𛁚 𛂢𛂞 𛁰𛂆𛀔,𛁸𛀽𛁓𛃋𛂇𛃧𛀧𛃣𛂐𛃇,𛂂𛃻𛃲𛁬𛃞𛀧𛃃𛀅 𛂭𛁠𛁡𛃇𛀷𛃓𛁥,𛁙𛁘𛁞𛃸𛁸𛃣𛁜,𛂛,𛃿,𛁯𛂘𛂌𛃛𛁱𛃌𛂈𛂇 𛁊𛃲,𛀕𛃴𛀜 𛀶𛂆𛀶𛃟𛂉𛀣,𛂐𛁞𛁾 𛁷𛂑𛁳𛂯𛀬𛃅,𛃶𛁼

Edmonton

Crossroads (UK TV series)