Example #1
0
        public void UpdateDatabase(MainDataContext db)
        {
            schemaUpdate = db.CreateDatabaseSchemaUpdater();
            if (schemaUpdate.DatabaseSchemaVersion < db.SCHEMAVERSION)
            {
                if (schemaUpdate.DatabaseSchemaVersion == 1)
                {
                    schemaUpdate.AddColumn<Location>("Distance");
                }

                schemaUpdate.DatabaseSchemaVersion = db.SCHEMAVERSION;
                schemaUpdate.Execute();
            }
        }
Example #2
0
 public MainViewModel()
 {
     db = new MainDataContext(MainDataContext.DBConnectionString);
     CreateDbIfNotExist();
 }