0

I have made a Entityframework model first to create tables to the database,

but then I found mistakes in my design, so I change the edmx model manually,
including changing the constraints between relationship as well as multiplicities.

So now, more error occur :

Error 3032: Problem in mapping fragments starting at lines ...,... are being mapped to the same rows in table Risk. Mapping conditions can be used to distinguish the rows that these types are mapped to.

Seems it's because the inconsistency between database and the model, there are lots of article discussing how to update the model from database, but not to update the database from the model. (Sorry if I missed a lot...)

To the person who's not familiar with T-SQL, the way convenient for me is just to update the model then expect the database will be updated consistently.

So please tell me is there any solution of this?

OOD Waterball
  • 707
  • 1
  • 11
  • 31
  • First delete the model from edmx file if you are using database first approach and then update model again. – Koderzzzz Jul 26 '17 at 09:39
  • But what I want is to **update the database** from all changes I did on the model. – OOD Waterball Jul 26 '17 at 09:41
  • If you change the model from its class file it will again affects whenever you update model from the database. – Koderzzzz Jul 26 '17 at 09:42
  • 1
    Can you generate the script from the model and run that script against the database or do you want to keep any existing data in the database? https://weblogs.asp.net/gunnarpeipman/entity-framework-4-0-generating-sql-script-from-model – undefined Jul 26 '17 at 11:25

0 Answers0