Esempio n. 1
0
        public ActionResult Default()
        {
            ViewBag.Title = "Photo Gallery";

            var db        = new PhotoGalleryRepository();
            var galleries = db.GetGalleryList();

            return(View(galleries));
        }
Esempio n. 2
0
        public ActionResult List()
        {
            var db        = new PhotoGalleryRepository();
            var galleries = db.GetGalleryList();

            var jsonGalleries = galleries.Select(gallery => new jsonGallery
            {
                id = gallery.Id, name = gallery.Name
            }).ToList();

            return(Json(jsonGalleries, JsonRequestBehavior.AllowGet));
        }