コード例 #1
0
        public static WorkTaskCommentModel ToModel(this WorkTaskComment entity)
        {
            if (entity == null)
            {
                Log.Error("参数无效。");
                throw new InvalidOperationException("参数无效。");
            }

            var model = new WorkTaskCommentModel()
            {
                Id          = entity.Id,
                TaskId      = entity.TaskId,
                UserId      = entity.UserId,
                Comment     = entity.Comment,
                CreatedTime = entity.CreatedTime
            };

            return(model);
        }
コード例 #2
0
        public static WorkTaskComment ToEntity(this WorkTaskCommentModel model)
        {
            if (model == null)
            {
                Log.Error("参数无效。");
                throw new InvalidOperationException("参数无效。");
            }

            var enity = new WorkTaskComment()
            {
                Id          = model.Id,
                TaskId      = model.TaskId,
                UserId      = model.UserId,
                Comment     = model.Comment,
                CreatedTime = model.CreatedTime
            };

            return(enity);
        }