Exemple #1
0
        /// <summary>
        /// Permanently delete the current gallery from the data store, including all related records. This action cannot
        /// be undone.
        /// </summary>
        public void Delete()
        {
            //Factory.GetDataProvider().Gallery_Delete(this);
            OnBeforeDeleteGallery();

            // Cascade delete relationships should take care of any related records not deleted in OnBeforeDeleteGallery.
            using (var repo = new GalleryRepository())
            {
                var galleryDto = repo.Find(GalleryId);
                if (galleryDto != null)
                {
                    // Delete gallery. Cascade delete rules in DB will delete related records.
                    repo.Delete(galleryDto);
                    repo.Save();
                }
            }

            Factory.ClearAllCaches();
        }
Exemple #2
0
 /*****************
  * DELETE
  */
 public IActionResult Delete(int galleryId)
 {
     galleryRepository.Delete(galleryId);
     return(Redirect("~/"));
 }
Exemple #3
0
        /// <summary>
        /// Permanently delete the current gallery from the data store, including all related records. This action cannot
        /// be undone.
        /// </summary>
        public void Delete()
        {
            //Factory.GetDataProvider().Gallery_Delete(this);
            OnBeforeDeleteGallery();

            // Cascade delete relationships should take care of any related records not deleted in OnBeforeDeleteGallery.
            using (var repo = new GalleryRepository())
            {
                var galleryDto = repo.Find(GalleryId);
                if (galleryDto != null)
                {
                    // Delete gallery. Cascade delete rules in DB will delete related records.
                    repo.Delete(galleryDto);
                    repo.Save();
                }
            }

            Factory.ClearAllCaches();
        }