Entity Framework 4: inheritance and Associations

匿名 (未验证) 提交于 2019-12-03 02:38:01

问题:

I do derive my entities from a base-class that provides tracking.

Since User derives from TrackableBase and TrackableBase is associated with User, I get an error:

"Unable to determine a valid ordering for dependent operations. Dependencies may exist due to foreign key constraints, model requirements or store generated values."

Is this model just not possible, or am I doing something wrong?

回答1:

Is CreatedByUser a nullable foriegn key? If not, you'll get a circular reference.

related: circular dependency in entity framework

/mikkel



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!