Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server &引用;无效对象dbo.RoleUsers“;在插入时首先使用EF数据库时出错_Sql Server_Database_Entity Framework_Associations_Ef Database First - Fatal编程技术网

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