//https://github.com/msallin/SQLiteCodeFirst
        //http://stackoverflow.com/questions/22101150/sqlite-ef6-programmatically-set-connection-string-at-runtime
        public static void SQLiteCodeFirstDemo()
        {
            string location = System.Reflection.Assembly.GetEntryAssembly().Location;
            string dbFilePath = Path.Combine(Path.GetDirectoryName(location), "demoDb.db");
            //string dbFilePath = @"data source=.\db\demoDb\demoDb.sqlite;foreign keys=true";

            DemoSqLiteCodeFirstDataBaseContext databaseContext = new DemoSqLiteCodeFirstDataBaseContext(dbFilePath);
            databaseContext.GetValidationErrors();
            //ModelEntry first = databaseContext.ModelEntries.First();
            //first.PointsEntries.Add(new PointEntry(){PointId = "pointID_0_0"});
            //int result = databaseContext.SaveChanges();
        }
Beispiel #2
0
        //https://github.com/msallin/SQLiteCodeFirst
        //http://stackoverflow.com/questions/22101150/sqlite-ef6-programmatically-set-connection-string-at-runtime
        public static void SQLiteCodeFirstDemo()
        {
            string location   = System.Reflection.Assembly.GetEntryAssembly().Location;
            string dbFilePath = Path.Combine(Path.GetDirectoryName(location), "demoDb.db");
            //string dbFilePath = @"data source=.\db\demoDb\demoDb.sqlite;foreign keys=true";

            DemoSqLiteCodeFirstDataBaseContext databaseContext = new DemoSqLiteCodeFirstDataBaseContext(dbFilePath);

            databaseContext.GetValidationErrors();
            //ModelEntry first = databaseContext.ModelEntries.First();
            //first.PointsEntries.Add(new PointEntry(){PointId = "pointID_0_0"});
            //int result = databaseContext.SaveChanges();
        }