[英]Using one table/model in two different EDMX maps
So I had a functioning Ado.Net project with a mysql database using EntityFramework. 所以我有一个运行正常的Ado.Net项目,使用EntityFramework建立了一个mysql数据库。 I have several tables, all of which had latitude and longitude fields.
我有几个表,所有的表都有纬度和经度字段。 I recently added a coordinate_addresses table, and modified all my existing tables with lat/long fields by replacing said fields with a coordinate_address_id field.
我最近添加了一个ordinate_addresses表,并通过将经纬度/经度字段替换为coordinate_address_id字段来修改所有现有的经/纬度表。 Now, pretty much all of my queries fail with the following error:
现在,几乎所有查询都失败,并显示以下错误:
Schema specified is not valid. Errors:
The relationship 'myModel.device_locations_ibfk_2' was not loaded because the type 'myModel.coordinate_addresses' is not available.
The following information may be useful in resolving the previous error:
The required property 'device_locations' does not exist on the type 'myNamespace.Database_Maps.coordinate_addresses'.
There are actually several of these errors where the relationship changes but the required property remains the same. 这些错误实际上有几种,它们之间的关系发生了变化,但所需的属性保持不变。 I have entirely recreated my EDMX maps to no success.
我已经完全重新创建了EDMX映射,但没有成功。
If any more information is required I will do my best to provide it! 如果需要更多信息,我会尽力提供!
EDIT: So I have two EDMX files. 编辑:所以我有两个EDMX文件。 When I run custom tool on one, it removes coordinate_addresses from the other.
当我在其中一个上运行自定义工具时,它会从另一个工具上删除axis_addresses。 In effect every time I fixed one EDMX I broke the other.
实际上,每次我修复一台EDMX时,我都会破坏另一本。 Can I not use the same model in two different db connectors?
我不能在两个不同的数据库连接器中使用同一模型吗? Please assist!
请协助!
If your edmx files are in the same namespace, try changing them. 如果您的edmx文件位于同一名称空间中,请尝试更改它们。 chances are custom finds it conflicting to create two objects with the same name in the same namespace.
自定义的机会是发现在同一名称空间中创建两个具有相同名称的对象是冲突的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.