Exemple #1
0
        public ActionResult Publish(PublishBlogInput input)
        {
            input.AuthorId = this.CurrentSession.UserId.Value;

            var blog = this.Service.Publish(input);

            return(this.SuccessData(blog));
        }
Exemple #2
0
        public BlogModel Publish(PublishBlogInput input)
        {
            Blog blog = this.Repository.GetBlogDetail(input.Id, input.AuthorId);

            blog.Author.UpdateBlog(blog, input);

            if (blog.Status == BlogStatus.Unpublished)
            {
                blog.Author.PublishBlog(blog);
            }

            this.UpdateBlog(blog);

            BlogModel ret = BlogModel.Create(blog);

            return(ret);
        }