Blog.Logic.Core.PostsLogic.DeletePost C# (CSharp) Method

DeletePost() public method

public DeletePost ( int postId ) : bool
postId int
return bool
        public bool DeletePost(int postId)
        {
            try
            {
                var db = _postRepository.Find(p => p.PostId == postId, true).FirstOrDefault();
                if (db == null) return false;

                _postRepository.Delete(db);
                return true;
            }
            catch (Exception ex)
            {
                throw new BlogException(ex.Message, ex.InnerException);
            }
        }