I implemented some db versioning logic with DatabaseSchemaUpdater and found one problem.
If I execute this code
updater.DatabaseSchemaVersion = updater.DatabaseSchemaVersion + new Random().Next(10)+1; updater.Execute();
and leave a request with the back button - everything is in order. Changed version of the scheme.
If I leave the Start button, and then run the application again (in my opinion, a fairly common case for a regular user) - nothing is updated. Db has a previous version.
calling Dispose () will fix this problem, but we are using the Singleton DataContext object, so this approach will be a little hacked for this case.
https://www.dropbox.com/s/wfyvwvjd12wifgl/DBUpdTest.zip - test project - you can just launch the application and close it in different ways and see what happens (db ver is written in text boxes).
Questions: Is this normal? Does deactivating and launching the application again violate something else? Is there any way around such things (except for Disposing)?
source share