Ejemplo n.º 1
0
        public ActionResult List()
        {
            var cupcakeModels = _cupcakeService.GetAllCupcakes()
                                .Select(x => x.ToModel()).OrderBy(x => x.Name).ToList();

            return(View(cupcakeModels));
        }
Ejemplo n.º 2
0
        public ActionResult Index()
        {
            //load list featured cupcakes and pass them to view
            var cupcakeModels = _cupcakeService.GetAllCupcakes()
                                .Select(x => x.ToModel())
                                .Where(x => x.Featured)
                                .OrderByDescending(x => x.LastModified).ToList();

            return(View(cupcakeModels));
        }