示例#1
0
        public ActionResult DeleteAlbum(int albumId)
        {
            var album = GalleryService.GetById(albumId);

            if (album != null)
            {
                foreach (var photo in album.Photos)
                {
                    DeletePhotoFromServer(photo.Path);
                }
                if (GalleryService.DeleteAlbum(albumId))
                {
                    return(RedirectToAction("index", "gallery"));
                }
            }
            return(View());
        }