Sql server &引用;无效对象dbo.RoleUsers“;在插入时首先使用EF数据库时出错
我有一个数据库,通过实体框架首先使用数据库生成模型 下图显示了数据库中的内容: 在代码中执行以下操作时(插入具有关联角色的用户): 在内部异常中我得到:Sql server &引用;无效对象dbo.RoleUsers“;在插入时首先使用EF数据库时出错,sql-server,database,entity-framework,associations,ef-database-first,Sql Server,Database,Entity Framework,Associations,Ef Database First,我有一个数据库,通过实体框架首先使用数据库生成模型 下图显示了数据库中的内容: 在代码中执行以下操作时(插入具有关联角色的用户): 在内部异常中我得到: Invalid object name dbo.RoleUsers 这很奇怪,因为我有一个表UserRoles,而不是RoleUsers 有人知道错误的来源是什么吗 谢谢, Ionut与EF无法找出joiner表的名称有关 An error occurred while saving entities that do not expose
Invalid object name dbo.RoleUsers
这很奇怪,因为我有一个表UserRoles,而不是RoleUsers
有人知道错误的来源是什么吗
谢谢,
Ionut与EF无法找出joiner表的名称有关
An error occurred while saving entities that do not expose foreign key properties for their relationships. The EntityEntries property will return null because a single entity cannot be identified as the source of the exception. Handling of exceptions while saving can be made easier by exposing foreign key properties in your entity types. See the InnerException for details.
Invalid object name dbo.RoleUsers