I am getting the following error. Could you please help me?
Msg 547, Level 16, State 0, Line 1
The INSERT statement conflicted with the FOREIGN
I had the same problem when I used code-first migrations to build my database for an MVC 5 application. I eventually found the seed method in my configuration.cs file to be causing the issue. My seed method was creating a table entry for the table containing the foreign key before creating the entry with the matching primary key.