简体   繁体   中英

Entity Framework Foreign Key Issue

I am getting a very frustrating issue:

System.Data.UpdateException was unhandled by user code
Message="Entities in 'MyProjectEntities.GroupingData' participate in the 'FK_GroupingData_AuditTrail' relationship.
0 related 'AuditTrail' were found. 1 'AuditTrail' is expected."

This happens when I try to add an object to the database in the GroupingData table. Every other table where I do inserts it's fine.

Furthermore, my EDMX properly reflects my database. I am dumbfounded. If any one has faced a similar situation in the past, I would like some advice.

使关系MyProjectEntities.GroupingData-> AuditTrail成为0..1-*?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM