Created
January 8, 2013 13:40
-
-
Save akimboyko/4483905 to your computer and use it in GitHub Desktop.
Load data from XML to in-memory SQLite instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SQLiteConnection connection = boundSession.GetConnection(); | |
using (var cmd = new SQLiteCommand("PRAGMA foreign_keys = OFF", connection)) | |
{ | |
cmd.ExecuteNonQuery(); | |
} | |
var sqlLiteUnitTest = new SqlLiteDbUnitTest(connection); | |
sqlLiteUnitTest.ReadXmlSchema(xsdFile); | |
sqlLiteUnitTest.ReadXml(xmlDataFile); | |
sqlLiteUnitTest.PerformDbOperation(DbOperationFlag.CleanInsertIdentity); | |
using (var cmd = new SQLiteCommand("PRAGMA foreign_keys = ON", (SQLiteConnection)connection)) | |
{ | |
cmd.ExecuteNonQuery(); | |
} | |
// In-memory SQLite instances are created per connection. Use same connection at unittest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment