Exemplo n.º 1
0
        public static BllCommentEntity ToBal(this DalCommentEntity itemCommentEntity)
        {
            if (itemCommentEntity == null)
            {
                return(null);
            }

            return(new BllCommentEntity
            {
                Id = itemCommentEntity.Id,
                Text = itemCommentEntity.Text,
                Article = itemCommentEntity.Article.ToBal(),
                Date = itemCommentEntity.Date,
                User = itemCommentEntity.User.ToBal()
            });
        }
Exemplo n.º 2
0
        public static Comment ToModel(this DalCommentEntity item)
        {
            if (item == null)
            {
                return(null);
            }
            Comment comment = new Comment
            {
                Id        = item.Id,
                Text      = item.Text,
                ArticleId = item.Article.Id,
                Date      = item.Date,
                UserId    = item.User.Id
            };

            return(comment);
        }
Exemplo n.º 3
0
        public static DalCommentEntity ToDal(this Comment item)
        {
            if (item == null)
            {
                return(null);
            }

            DalCommentEntity tagDalEntity = new DalCommentEntity
            {
                Id      = item.Id,
                Text    = item.Text,
                Article = item.Article.ToDal(),
                User    = item.User.ToDal(),
                Date    = item.Date
            };

            return(tagDalEntity);
        }