Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Issue with "add-migration initial" command in Package Manager Console

I’m encountering an error, as shown in the screenshot, when I run the "add-migration initial" command in the Package Manager Console in the following project.
https://github.com/BKarayilmaz/NLayerLearningApp

Error

Cannot use table ‘Products’ for entity type ‘ProductFeature’ since it is being used for entity type ‘Product’ and potentially other entity types, but there is no linking relationship. Add a foreign key to ‘ProductFeature’ on the primary key properties and pointing to the primary key on another entity type mapped to ‘Products’.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

Any ideas on how to resolve this?

>Solution :

Well you’re simply "reusing" the Products table.

I would guess this should be "ProductFeatures" instead:
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading