예제 #1
0
        //the paramter int is added to the last section of the url
        // the ? mark just makes it non nullable
        // commibBook/Detail/id
        public ActionResult Detail(int?id)
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            var comicBook = _comicbookRepo.GetCommicBook((int)id);

            //var comicBook = new ComicBook()
            //{ //object initializer syntax


            //    SerisTitle = "The amazing Spider-Man",
            //    issueNumber = 700,
            //    DescriptionHTML = "<p>Final issue! Witness the final hours of Doctor Octopus' life and his one, last, great act of revenge! Even if Spider-Man survives... <strong>will Peter Parker?</strong></p>",
            //    artists = new Artists[]
            //    {
            //     new Artists() { Name = "Dan Slott", Role="Script"},
            //     new Artists() { Name = "Humberto Ramos", Role = "Pencils" },
            //     new Artists() { Name = "Victor Olazaba", Role="Inks"},
            //     new Artists() { Name = "Edgar Delgado", Role = "Colors" },
            //     new Artists() { Name = "Chris Elipoulos", Role = "Letters" },
            //    }


            //};



            //    ViewBag.SerisTitle = "The amazing Spider-Man";
            //    ViewBag.IssueNumber = 700;
            //    ViewBag.Image = "";
            //    ViewBag.Description = "<p>Final issue! Witness the final hours of Doctor Octopus' life and his one, last, great act of revenge! Even if Spider-Man survives... <strong>will Peter Parker?</strong></p>";
            //    ViewBag.Artists = new string[]
            //    {
            //"Inks: Victor Olazaba",
            //"Colors: Edgar Delgado",
            //"Letters: Chris Eliopoulos"
            //    };

            // UPdate view to be strongly typed MVC view associated with a type
            // Exposes model instance  with model property
            return(View("Detail", comicBook));
        }