I am working on an integration test project where I have a local database inside the solution file of the project which on every compile gets copied to the 'bin/debug' which then is used.
Now, I have a requirement to only make changes to the database in the debug mode so that we do not make any changes to the original database and a large database file doesn't get pushed to source control.
I know that there is an option in Visual Studio that results in changing data only to the database in the bin folder while the original database stays intact, I want something exactly like that.
also, I just need to copy the original database to the bin folder only on first build (when there is no .mdf in bin)
Properties for database file in Visual Studio are as follow:
Content > Copy Always
My connection string is this:
<add name="MaxDatabase"
connectionString="Data Source=(LocalDb)\ProjectsV13;Initial Catalog=Catalog=MaxLocalEmbeded;Integrated Security=SSPI"
providerName="System.Data.SqlClient" />
I need something like the OP's problem here: https://stackoverflow.com/a/17147460/5360889
Any help with this will be highly appreciated. Thanks!