public async Task <IEnumerable <BattleDto> > GetAllBattlesAsync() { return((await _battleRepository.GetAllBattles()) .Select(x => new BattleDto() { Id = x.Id, Name = x.Name })); }
public async Task <IActionResult> GetBattles() { IEnumerable <Battle> battles = await _battleRepository.GetAllBattles(); return(Ok(battles)); }