Пример #1
0
        public async Task <ActionResult <EnemyDto> > Get()
        {
            var enemies = await _enemyRepository.GetEnemies();

            var enemy = enemies.ToList()[_rnd.Next(0, enemies.ToList().Count)];

            return(Ok(enemy));
        }
Пример #2
0
        public async Task <ActionResult <IEnumerable <EnemyDto> > > Get()
        {
            var enemies = await _enemyRepository.GetEnemies();

            if (enemies.ToList().Count == 0)
            {
                return(NoContent());
            }

            return(Ok(enemies));
        }