Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: , +
I want to drop some tables and create again following my models design. But the CodeFirst never do it, keeping trying to apply the changes that I did, but for some reason he can't. The Designs of models class is ok but the tables on SQL is not and thats why and want to drop and recreate again. I need to keep the data of all others tables.

I did some changes on model and especially with keys and Foreign Keys. So why I think if I could set which tables I would like to drop, code first will Understand my new implementation.

Erro output update-database


Unable to determine the principal end of an association between the types 'Target.Data.Model.TacticalGoal' and 'Target.Data.Model.ICB'. The principal end of this association must be explicitly configured using either the relationship fluent API or data annotations.
Posted

 
Share this answer
 
Google for "entity framework 5 code first migrations" and you'll find what you're looking for.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900