Julien
Julien

Reputation: 282

Using one table/model in two different EDMX maps

So I had a functioning Ado.Net project with a mysql database using EntityFramework. 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. 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.

If any more information is required I will do my best to provide it!

EDIT: So I have two EDMX files. When I run custom tool on one, it removes coordinate_addresses from the other. In effect every time I fixed one EDMX I broke the other. Can I not use the same model in two different db connectors? Please assist!

Upvotes: 0

Views: 204

Answers (1)

humblelistener
humblelistener

Reputation: 1456

If your edmx files are in the same namespace, try changing them. chances are custom finds it conflicting to create two objects with the same name in the same namespace.

Upvotes: 1

Related Questions