public void active(long gallery_id) { try { var gallery = _galleryRepository.getById(gallery_id); if (gallery == null) { throw new ItemNotFoundException($"Gallery with id {gallery_id} doesnot exist."); } gallery.is_active = true; _galleryRepository.update(gallery); } catch (Exception) { throw; } }
public IActionResult edit(long gallery_id) { try { CMS.Core.Entity.Gallery gallery = _galleryRepository.getById(gallery_id); GalleryModel galleryModel = _mapper.Map <GalleryModel>(gallery); return(View(galleryModel)); } catch (Exception ex) { AlertHelper.setMessage(this, ex.Message, messageType.error); return(RedirectToAction("index")); } }