public DBLoader(ObservableCollection<DBGame> games, ChessEntities db, String connectionString) { DB = db; Games = games; ConnectionString = connectionString; WorkerReportsProgress = true; DoWork += Import; ProgressChanged += MakeProgress; var lastGame = DB.Games.OrderByDescending(u => u.ID).FirstOrDefault(); if (lastGame == null) LastID = 0; else LastID = lastGame.ID + 1; }
private void InitializeDB() { DB = new ChessEntities(); }