When I generated the EDMX file it set the Schema for each EntitySet
<EntitySet
Name="TableName"
EntityType="Model.Store.TableName"
store:Type="Tables"
Schema="MySchema" />
The problem is that if I want to switch to the production database I have to change the EDMX since I don't know how to choose the Schema in the connection string.
How to do it?
Under the Details tab select Connect Identifier. Put the connection string into the text box next to Connect Identifier. Click Test if you'd like, to make sure it works. Click Save.
I just had to edit the EDMX and remove the Schema from every EntitySet
<EntitySet
Name="TableName"
EntityType="Model.Store.TableName"
store:Type="Tables" />
Now it connects to the default schema for a given user.
If the code first method is an option you can override the OnModelCreating method in your DbContext class. In the OnModelCreating method you can put logic in to detect oracle and rename the schema accordingly. The code first approach has been asked about here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With