Exemplo n.º 1
0
        public ViewResult Index(int?page)
        {
            int pageNumber = (page ?? 1);

            IEnumerable <Chef> chefs = _chefService.GetAllChefs();
            IEnumerable <ChefIndexViewModel> model
                = Mapper.Map <IEnumerable <Chef>, IEnumerable <ChefIndexViewModel> >(chefs);

            model = model.ToPagedList(pageNumber, PageSize);
            return(View(model));
        }