Example #1
0
        public async Task <IActionResult> FindMovie(
            [FromRoute] Guid movieId,
            [FromServices] MovieReadModelFacade readModelFacade)
        {
            MovieDto movie = await readModelFacade.FindMovie(movieId);

            return(movie == null?NotFound() : (IActionResult)Ok(movie));
        }
Example #2
0
        public async Task <IActionResult> FindScreening(
            [FromRoute] Guid movieId,
            [FromRoute] Guid screeningId,
            [FromServices] MovieReadModelFacade readModelFacade)
        {
            MovieDto movie = await readModelFacade.FindMovie(movieId);

            ScreeningDto screening = movie?
                                     .Screenings
                                     .SingleOrDefault(s => s.Id == screeningId);

            return(screening == null
                ? NotFound()
                : (IActionResult)Ok(screening));
        }