public void delete(long blog_id) { try { using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required)) { var BlogCommentCategory = _blogCommentRepo.getById(blog_id); if (BlogCommentCategory == null) { throw new ItemNotFoundException($"Blog Comment Category With Id {BlogCommentCategory} doesnot Exist."); } _blogCommentRepo.delete(BlogCommentCategory); tx.Complete(); } } catch (Exception) { throw; } }
public IActionResult blogCommentEdit(long blog_comment_id) { try { var blogComment = _blogCommentRepo.getById(blog_comment_id); BlogCommentDto blogCommentDto = _mapper.Map <BlogCommentDto>(blogComment); return(View(blogCommentDto)); } catch (Exception ex) { AlertHelper.setMessage(this, ex.Message, messageType.error); return(RedirectToAction("index")); } }