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(); }
public void Post([FromBody] InsertCommentDto dto, [FromServices] ICreateCommentCommand command) { executor.ExecuteCommand(command, dto); }