BlogEngine.Core.API.MetaWeblog.MetaWeblogHandler.DeletePost C# (CSharp) Method

DeletePost() private method

blogger.deletePost method
private DeletePost ( string appKey, string postId, string userName, string password, bool publish ) : bool
appKey string /// Key from application. Outdated methodology that has no use here. ///
postId string /// post guid in string format ///
userName string /// login username ///
password string /// login password ///
publish bool /// mark as published? ///
return bool
        internal bool DeletePost(string appKey, string postId, string userName, string password, bool publish)
        {
            try
            {
                var post = Post.GetPost(new Guid(postId));

                if (!post.CanUserDelete)
                {
                    throw new MetaWeblogException("11", "User authentication failed");
                }

                post.Delete();
                post.Save();
            }
            catch (Exception ex)
            {
                throw new MetaWeblogException("12", string.Format("DeletePost failed.  Error: {0}", ex.Message));
            }

            return true;
        }