General information
Category:
Entity Framework
Environment versions
Network:
Windows Server 2012
>I have a database in a production server with a rather simple structure that I use to generate Context and Model. I have a sandbox server in which I restore the database from a backup that I use for testing.
>
>I wonder what the best approach is to switch between the two servers, ideally they would use the same EF project and just have different connection strings. I just do not get how to make that work.
>
>Alternatively I could have 2 separate (identical) EF projects and instatiate the context that i need at runtime. I'm ,not too hot about this because in the future my database structure might change a lot, and I don't think regenerating 2 EF projects rather than one is such a good idea.
>
>Or am I just not using the right technology? :)
The connection strings are usually in the config file so just a question of using different configs for the two databases.
Find the EntityContainerName in Edmx properties and look for that in the configuration/connectionStrings section.
The actual connection string for the SQL server is contained in the connectionString property (provider connection string)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only