public async Task <IEnumerable <ApiChampions> > getChampions() { var championsTask = await _championsRepository.getChampions(); List <Champions> champions = championsTask.ToList(); List <ApiChampions> championsToReturn = new List <ApiChampions>(); champions.ForEach(champ => championsToReturn.Add(ChampionsMapper.convertToApiModel(champ))); return(championsToReturn); }
public async Task <IEnumerable <ApiChampions> > getAvailableChampionsForAccount(string userName) { var championsTask = await _championsRepository.getAvailableChampionsForAccount(userName); List <Champions> champions = championsTask.ToList(); List <ApiChampions> championsToReturn = new List <ApiChampions>(); champions.ForEach(champ => championsToReturn.Add(ChampionsMapper.convertToApiModel(champ))); return(championsToReturn); }
public ApiChampions getChampion(int champId) { Champions champion = _championsRepository.getChampion(champId); return(ChampionsMapper.convertToApiModel(champion)); }