I have an error here and can't quite get the logic behind it. I am using Entity Framework 6 with a model-first approach. I have designed two tables that reference each other like this:
Basically, an account needs to be in a company while a company has to have an account as an administrator. However, I get an error from the EF validator:
Error 3014: Problem in mapping fragments starting at lines 224, 249:The foreign key 'Foreign key constraint 'CompaniesAccounts1' from table CompaniesSet (Id) to table AccountsSet (Id):' is not being enforced in the model. An Association or inheritance relationship needs to be created to enforce this constraint.
CompaniesAccounts1
is the first association (1...*) you see here, Accounts
being the principal. The second association has Companie
s as principal. Anybody know why I am getting this error?
All 4 properties are non-nullable Int32
types.