public async Task UpdateAsync(Player player) { if (player == null || player.Id == default(int)) { return; } using (var db = new FootballBotDbContext(_options)) { db.Entry(player).State = EntityState.Modified; await db.SaveChangesAsync(); } }
public async Task UpdateMultipleAsync(IEnumerable <Player> players) { if (!players.Any()) { return; } using (var db = new FootballBotDbContext(_options)) { foreach (var player in players) { db.Entry(player).State = EntityState.Modified; } await db.SaveChangesAsync(); } }