Exemplo n.º 1
0
        public AllPublicationsViewModel GetAll()
        {
            List <Book>     allBooksModel     = _unitOfWork.Books.GetAll();
            List <Magazine> allMagazinesModel = _unitOfWork.Magazines.GetAll();
            List <Brochure> allBrochuresModel = _unitOfWork.Brochures.GetAll();

            var allPublicationsViewModel = new AllPublicationsViewModel();

            allPublicationsViewModel.Books     = Mapper.Map <List <Book>, List <BookViewModel> >(allBooksModel);
            allPublicationsViewModel.Magazines = Mapper.Map <List <Magazine>, List <MagazineViewModel> >(allMagazinesModel);
            allPublicationsViewModel.Brochures = Mapper.Map <List <Brochure>, List <BrochureViewModel> >(allBrochuresModel);

            return(allPublicationsViewModel);
        }
Exemplo n.º 2
0
        public JsonResult GetAll()
        {
            AllPublicationsViewModel allMagazines = _allPublicationsService.GetAll();

            return(Json(allMagazines, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 3
0
        public ActionResult AllPublications()
        {
            AllPublicationsViewModel allPublications = _allPublicationsService.GetAll();

            return(View(allPublications));
        }