Ejemplo n.º 1
0
        public ActionResult Detail(int id)
        {
            //ViewBag.ComicBook = comicBook;

            //pass model, strongly typed
            return(View(ComicBookRepository.GetComicBook(id)));
        }
 public ComicBooksController()
 {
     // Context parameter is BaseController's Context property
     _comicBookRepository = new ComicBookRepository(Context);
     _seriesRepository    = new SeriesRepository(Context);
     _artistsRepository   = new ArtistsRepository(Context);
 }
 public ActionResult Detail(int?id)
 {
     if (id == null)
     {
         return(HttpNotFound());
     }
     return(View(ComicBookRepository.GetComicBook((int)id)));
 }
        public ActionResult Detail(int?id)
        {
            var comicBook = new ComicBook();

            if (id == null)
            {
                return(HttpNotFound());
            }
            else
            {
                comicBook = ComicBookRepository.GetComicBook(id.Value);
            }


            return(View(comicBook));
        }
Ejemplo n.º 5
0
        public ActionResult DetailByViewOnEntity(int?id)  // Action Method
        {
            if (id == null)
            {
                return(HttpNotFound());
            }
            //
            var lRepository = new ComicBookRepository();

            ViewBag.DetailOnController = "This Note Sent From Controller On ViewBag!!!";
            var lComicBook = lRepository.GetComicBook(id.GetValueOrDefault(0));

            if (lComicBook == null)
            {
                return(HttpNotFound());
            }
            return(View(lComicBook));
        }
Ejemplo n.º 6
0
 public ActionResult Detail(int?id) =>
 (id == null) ? HttpNotFound() : (ActionResult)View(ComicBookRepository.GetComicBook(id.Value));
Ejemplo n.º 7
0
 public ComicBookArtistsController()
 {
     _comicBookRepository       = new ComicBookRepository(Context);
     _comicBookArtistRepository = new ComicBookArtistRepository(Context);
     _artistsRepository         = new ArtistsRepository(Context);
 }
 public ComicBooksController() //Constructor
 {
     _comicBookRepository = new ComicBookRepository();
 }
 public ComicBookController()
 {
     _repo = new ComicBookRepository();
 }
        public ActionResult Index()
        {
            var comicBooks = ComicBookRepository.GetComicBooks();

            return(View(comicBooks));
        }
 public ComicBooksController(ComicBookRepository repository)
 {
     _comicBookRepository = repository;
 }
Ejemplo n.º 12
0
 public ComicBooksController() //contructor for ComicBooksRepo, note constructors dont have a return type
 {
     _comicBookRepository = new ComicBookRepository();
 }
Ejemplo n.º 13
0
 public ComicBooksController()
 {
     _comicBookRepository         = new ComicBookRepository(Context);
     _seriesRepository            = new SeriesRepository(Context);
     _artistsRepositoryRepository = new ArtistsRepository(Context);
 }
 public ActionResult Index()
 {
     return(View(ComicBookRepository.GetComicBooks()));
 }
 public ComicBooksController() //constructor-> used to initialize instance members. No return type, name matches class name.
 {
     _comicBookRepository = new ComicBookRepository();
 }
Ejemplo n.º 16
0
 public ActionResult Index() => View(ComicBookRepository.GetComicBooks());
Ejemplo n.º 17
0
 public ComicBooksController()
 {
     _comicBookRepository = new ComicBookRepository();
 }
Ejemplo n.º 18
0
 public ActionResult Index()
 {
     ComicBook[] comicBooks = ComicBookRepository.GetAllComicBooks();
     return(View(comicBooks));
 }