public void Execute(InsertCommentDto request)
        {
            validator.ValidateAndThrow(request);
            var comment = new Comments
            {
                IdPost  = request.PostId,
                Id      = request.Id,
                Comment = request.Comment,
                UserId  = request.UserId
            };

            _context.Comments.Add(comment);
            _context.SaveChanges();
        }
示例#2
0
 public void Post([FromBody] InsertCommentDto dto, [FromServices] ICreateCommentCommand command)
 {
     executor.ExecuteCommand(command, dto);
 }