public static void DeleteGame(Game game) { using (var db = new EloDbContext()) { db.Games.Remove(game); db.SaveChanges(); } }
public static void DeletePlayers(IEnumerable <Player> players) { using (var db = new EloDbContext()) { db.Players.RemoveRange(players); db.SaveChanges(); } }
public static void DeleteAllPlayerSeasons() { using (var db = new EloDbContext()) { db.PlayerSeasons.RemoveRange(db.PlayerSeasons); db.SaveChanges(); } }
public static void UpdatePlayerSeasons(IEnumerable <PlayerSeason> playerSeasons) { using (var db = new EloDbContext()) { db.PlayerSeasons.UpdateRange(playerSeasons); db.SaveChanges(); } }
public static void DeleteRatingsAfter(int ratingId, bool deleteDefaultRatings = true) { using (var db = new EloDbContext()) { db.Ratings.RemoveRange(db.Ratings.Where(r => r.Id > ratingId && (deleteDefaultRatings || r.GameId != null))); db.SaveChanges(); } }
public static void AddRatings(IEnumerable <PlayerRating> ratings) { using (var db = new EloDbContext()) { db.Ratings.AddRange(ratings); db.SaveChanges(); } }
public static void AddRating(PlayerRating rating) { using (var db = new EloDbContext()) { db.Ratings.Add(rating); db.SaveChanges(); } }
public static Season AddSeason(Season season) { using (var db = new EloDbContext()) { db.Seasons.Add(season); db.SaveChanges(); } return(season); }
public static Game AddGame(Game game) { using (var db = new EloDbContext()) { db.Games.Add(game); db.SaveChanges(); } return(game); }
public static Player AddPlayer(Player player) { using (var db = new EloDbContext()) { db.Players.Add(player); db.SaveChanges(); } return(player); }
public static PlayerSeason AddPlayerSeason(PlayerSeason playerSeason) { using (var db = new EloDbContext()) { db.PlayerSeasons.Add(playerSeason); db.SaveChanges(); } return(playerSeason); }