Beispiel #1
0
        public ActionResult AddAndPublish(AddBlogInput input)
        {
            input.AuthorId = this.CurrentSession.UserId.Value;

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

            return(this.SuccessData(blog));
        }
Beispiel #2
0
        public BlogModel AddAndPublish(AddBlogInput input)
        {
            User user = this._userRepository.Get(input.AuthorId);

            Blog blog = user.CreateBlog(input);

            user.PublishBlog(blog);

            this.AddBlog(blog);

            BlogModel ret = BlogModel.Create(blog);

            return(ret);
        }