示例#1
0
        /// <summary>
        /// 将blogPost标记为已删除
        /// </summary>
        public void DeleteBlogPost(Guid blogPostId)
        {
            BlogPostEntity blogPostEntity = FindBlogPost(blogPostId);

            blogPostEntity.HasDeleted = true;
            blogPostRepository.SaveOne(blogPostEntity);
        }
示例#2
0
 /// <summary>
 /// 修改blogPost
 /// </summary>
 public void ModifyBlogPost(BlogPostEntity blogPostEntity, string title, string content)
 {
     blogPostEntity.Title      = title;
     blogPostEntity.Content    = content;
     blogPostEntity.ModifyTime = DateTime.Now;
     blogPostRepository.SaveOne(blogPostEntity);
 }
示例#3
0
 /// <summary>
 /// 激活blogPost
 /// </summary>
 public void ActivateBlogPost(BlogPostEntity blogPostEntity)
 {
     if (blogPostEntity.IsActivated == false)
     {
         blogPostEntity.IsActivated = true;
         blogPostEntity.ModifyTime  = DateTime.Now;
         blogPostRepository.SaveOne(blogPostEntity);
     }
 }
示例#4
0
        public void AddBlogPost(BasicUser user, Guid targetId, string title, string content)
        {
            BlogPostEntity blogPostEntity = new BlogPostEntity(user, targetId, title, content);

            blogPostRepository.SaveOne(blogPostEntity);
        }
示例#5
0
        public BlogPostEntity FindBlogPost(Guid blogPostId)
        {
            BlogPostEntity result = blogPostRepository.FindOneById(blogPostId);

            return(result);
        }