Exemplo n.º 1
0
        public TaskCommentCreate(TaskCommentCreateRequest request)
        {
            if (request != null)
            {
                if (string.IsNullOrWhiteSpace(request.Content))
                {
                    Response = new TaskCommentCreateResponse
                    {
                        Type = TaskCommentCreateResponseType.ContentEmpty
                    };
                    return;
                }

                using (var dbContext = new ApplicationDbContext())
                {
                    var taskComment = new TaskComment();
                    taskComment.Set(request);
                    dbContext.TaskComents.Add(taskComment);
                    dbContext.SaveChanges();

                    Response = new TaskCommentCreateResponse
                    {
                        Type = TaskCommentCreateResponseType.Success
                    };
                }
            }
        }
Exemplo n.º 2
0
 public TaskCommentCreateResponse TaskCommentCreate(TaskCommentCreateRequest request)
 => new TaskCommentCreate(request).Response;
Exemplo n.º 3
0
 public void Set(TaskCommentCreateRequest request)
 {
     Content        = request.Content;
     TaskIdentifier = request.TaskIdentifier;
     UserIdentifier = request.UserIdentifier;
 }