JustBlog.Core.BlogRepository.DeletePost C# (CSharp) Method

DeletePost() public method

Delete the post permanently from database.
public DeletePost ( int id ) : void
id int
return void
        public void DeletePost(int id)
        {
            using (var tran = _session.BeginTransaction())
              {
            var post = _session.Get<Post>(id);
            if (post != null) _session.Delete(post);
            tran.Commit();
              }
        }