Ejemplo n.º 1
0
        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();
            }
        }
Ejemplo n.º 2
0
        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();
            }
        }