public CommentEntity(BasicUser user, Guid targetId, Guid fatherId, string content)
     : base(user, targetId, content)
 {
     FatherId   = fatherId;
     ChildrenId = new List <Guid>();
     Position   = 0;
 }
Exemple #2
0
 public BlogEntity()
 {
     EntityType = TYPE;
     User       = new BasicUser();
     CreateTime = DateTime.Now;
     HasDeleted = false;
 }
Exemple #3
0
 public BlogEntity(BasicUser user, Guid targetId, string content)
 {
     Id         = Guid.NewGuid();
     User       = user;
     TargetId   = targetId;
     Content    = content;
     CreateTime = DateTime.Now;
     HasDeleted = false;
 }
Exemple #4
0
        public BlogEntity(BasicUser user, Guid targetId, string content) : base()
        {
            EntityType = TYPE;

            User       = user;
            TargetId   = targetId;
            Content    = content;
            CreateTime = DateTime.Now;
            HasDeleted = false;
        }
Exemple #5
0
 public BlogPostEntity(BasicUser user, Guid targetId, string title, string content)
     : base(user, targetId, content)
 {
     Title       = title;
     IsActivated = false;
     ModifyTime  = DateTime.Now;
     this.Asset  = new List <Asset>();
     EntityType  = TYPE;
     BlogType    = TYPE;
 }
Exemple #6
0
 public BlogPostEntity(BasicUser user, Guid targetId, string title, string content)
     : base(user, targetId, content)
 {
     Title          = title;
     IsActivated    = false;
     ModifyTime     = DateTime.Now;
     this.Asset     = new Asset();
     readTimes      = 0;
     likedTimes     = 0;
     reprintedTimes = 0;
     rating         = 0;
 }
 public BlogEntity()
 {
     EntityType = TYPE;
     User       = new BasicUser();
     CreateTime = DateTime.Now;
     HasDeleted = false;
     //ReadTimes = 0;
     //LikedTimes = 0;
     ReprientedTimes = 0;
     Rating          = 0;
     //FavoriteTimes = 0;
 }
 public BlogEntity(BasicUser user, Guid targetId, string content) : base()
 {
     EntityType = TYPE;
     User       = user;
     TargetId   = targetId;
     Content    = content;
     CreateTime = DateTime.Now;
     HasDeleted = false;
     //ReadTimes = 0;
     //LikedTimes = 0;
     ReprientedTimes = 0;
     Rating          = 0;
     //FavoriteTimes = 0;
 }
Exemple #9
0
 public BlogPostEntity(BasicUser user, Guid targetId, string title, string content, List <Asset> asset)
     : base(user, targetId, content)
 {
     Title          = title;
     IsActivated    = false;
     ModifyTime     = DateTime.Now;
     this.Asset     = new List <Asset>();
     readTimes      = 0;
     likedTimes     = 0;
     reprintedTimes = 0;
     rating         = 0;
     EntityType     = TYPE;
     BlogType       = TYPE;
     Asset          = Asset;
 }
Exemple #10
0
        public virtual void AddComment(BasicUser user, Guid targetId, Guid fatherId, string content)
        {
            //先计算楼层
            Dictionary <string, object> queryDict = new Dictionary <string, object>();

            queryDict.Add("TargetId", targetId);
            QueryObject <CommentEntity> queryObject = new QueryObject <CommentEntity>(EntityRepository);

            queryObject.AppendQuery(queryDict, QueryLogic.And);
            int position = Convert.ToInt32(EntityRepository.FindCountOfResult(queryObject)) + 1;
            //加入数据库
            CommentEntity newComment = new CommentEntity(user, targetId, fatherId, content);

            newComment.Position = position;
            EntityRepository.SaveOne(newComment);
            //当存在father时
            //在father的children中加入该comment
            if (fatherId != Guid.Empty)
            {
                CommentEntity father = FindOneById(fatherId);
                father.ChildrenId.Add(newComment.Id);
                EntityRepository.SaveOne(father);
            }
        }
        public void AddBlogPost(BasicUser user, Guid targetId, string title, string content)
        {
            BlogPostEntity blogPostEntity = new BlogPostEntity(user, targetId, title, content);

            blogPostRepository.SaveOne(blogPostEntity);
        }
        public virtual void AddBlogPost(BasicUser user, Guid targetId, string title, string content, List <Asset> asset)
        {
            BlogPostEntity blogPostEntity = new BlogPostEntity(user, targetId, title, content, asset);

            EntityRepository.SaveOne(blogPostEntity);
        }