public ActionResult <Locatie> GetLocatie(int id)
        {
            Locatie locatie = _locatieRepository.GetById(id);

            if (locatie == null)
            {
                return(NotFound());
            }
            return(locatie);
        }
예제 #2
0
        //Haalt films voor een bepaalde dag op
        public IEnumerable <FilmOverviewPresentationModel> GetAllFilmsForDay(DateTime day)
        {
            //Haal alle films voor een bepaalde dag uit de filmrepository
            IEnumerable <Film> movies = filmRepository.GetAllForDay(day);
            List <FilmOverviewPresentationModel> moviePresentations = new List <FilmOverviewPresentationModel>();

            //Zet elke film om in een FilmOverviewPresentationModel
            foreach (Film f in movies)
            {
                Locatie locatie = locatieRepository.GetById(f.Event.Locatie.id);
                FilmOverviewPresentationModel moviePresentation = new FilmOverviewPresentationModel(f.EventId, f.naam, (double)f.Event.rating, f.Event.afbeelding_url, f.Event.begin_datumtijd, f.Event.eind_datumtijd, locatie, f.Event.beschrijving);
                moviePresentations.Add(moviePresentation);
            }
            //Return de list as Enumerable
            return(moviePresentations.AsEnumerable());
        }