public IEnumerable <ConcertModel> GetConcerts()
        {
            var concerts = _concerts.GetConcerts();
            IList <ConcertModel> concertModels = new List <ConcertModel>();

            foreach (var concert in concerts)
            {
                concertModels.Add(new ConcertModel(concert.Id, concert.Title));
            }

            return(concertModels);
        }
Пример #2
0
        public IEnumerable <ConcertViewModel> GetConcerts()
        {
            var allConcerts = _concerts.GetConcerts();

            var result = new List <ConcertViewModel>(allConcerts.Count());

            foreach (var concert in allConcerts)
            {
                result.Add(CreateConcertVM(concert));
            }

            return(result);
        }