Exemplo n.º 1
0
        public async Task <IActionResult> View(int id)
        {
            var slide = await repo.GetSlideAsync(id);

            if (slide == null)
            {
                return(NotFound());
            }
            var prev = await repo.GetPrevSlideAsync(slide);

            var next = await repo.GetNextSlideAsync(slide);

            ViewData["Title"] = slide.Header;
            var model    = CreateSlideViewModelWithNavigation(slide, prev, next);
            var template = String.IsNullOrWhiteSpace(model.Template) ? "Default" : model.Template;

            return(Negotiate("../Slideshow/" + template, model));
        }