示例#1
0
 public IActionResult Post(
     [FromBody] CommentDto dto,
     [FromServices] ICreateCommentCommand command)
 {
     _executor.ExecuteCommand(command, dto);
     return(StatusCode(StatusCodes.Status201Created));
 }
示例#2
0
 public IActionResult Post([FromBody] CommentDto dto,
                           [FromServices] ICreateCommentCommand command)
 {
     dto.UserId = _actor.Id;
     _executor.ExecuteCommand(command, dto);
     return(NoContent());
 }
 public CommentsController(IGetCommentsCommand searchCommentsCommand, IGetCommentCommand getOneCommentCommand, ICreateCommentCommand createCommentCommand, IEditCommentCommand editCommentCommand, IDeleteCommentCommand deleteCommentCommand)
 {
     _searchCommentsCommand = searchCommentsCommand;
     _getOneCommentCommand  = getOneCommentCommand;
     _createCommentCommand  = createCommentCommand;
     _editCommentCommand    = editCommentCommand;
     _deleteCommentCommand  = deleteCommentCommand;
 }
 public CommentsController(ICreateCommentCommand createComment, IGetCommentsCommand getAll, IGetCommentCommand getOne, IEditCommentCommand editComment, IDeleteCommentCommand deleteComment)
 {
     _createComment = createComment;
     _getAll        = getAll;
     _getOne        = getOne;
     _editComment   = editComment;
     _deleteComment = deleteComment;
 }
示例#5
0
 public CommentController(
     UserManager <ApplicationUser> userManager,
     ICreateCommentCommand createCommentCommand,
     IEditCommentCommand editCommentCommand)
 {
     _userManager          = userManager;
     _createCommentCommand = createCommentCommand;
     _editCommentCommand   = editCommentCommand;
 }
示例#6
0
 public CommentsController(IGetAdCommentsCommand getAdCommentsCommand,
                           UserManager <ApplicationUser> userManager,
                           IGetCommentCommand getCommentCommand,
                           IEditCommentCommand editCommentCommand,
                           ICreateCommentCommand createCommentCommand)
 {
     _getAdCommentsCommand = getAdCommentsCommand;
     _userManager          = userManager;
     _getCommentCommand    = getCommentCommand;
     _editCommentCommand   = editCommentCommand;
     _createCommentCommand = createCommentCommand;
 }
 public IActionResult Post([FromBody] AddComment dto, [FromServices] ICreateCommentCommand com)
 {
     try
     {
         executor.ExecuteCommand(com, dto);
         return(StatusCode(202, "Comment added"));
     }
     catch (EntityAllreadyExists)
     {
         return(StatusCode(422, "Fail"));
     }
 }
 public ProductController(IGetProductQuery getProductQuery, IGetRelatedProductQuery getRelatedProductQuery, IGetProductDetailQuery getProductDetailQuery, IGetRateQuery getRateQuery, IGetCommentQuery getCommentQuery, IGetCategoryQuery getCategoryQuery, ICreateCommentCommand createCommentCommand, ICreateRateCommand createRateCommand, IUpdateCommentCommand updateCommentCommand, IDeleteCommentCommand deleteCommentCommand)
 {
     this.getProductQuery        = getProductQuery;
     this.getRelatedProductQuery = getRelatedProductQuery;
     this.getProductDetailQuery  = getProductDetailQuery;
     this.getRateQuery           = getRateQuery;
     this.getCommentQuery        = getCommentQuery;
     this.getCategoryQuery       = getCategoryQuery;
     this.createCommentCommand   = createCommentCommand;
     this.createRateCommand      = createRateCommand;
     this.updateCommentCommand   = updateCommentCommand;
     this.deleteCommentCommand   = deleteCommentCommand;
 }
示例#9
0
 public void Post(int id, [FromBody] CommentDto dto, [FromServices] ICreateCommentCommand command)
 {
     _executor.ExecuteCommandComment(command, dto, id);
 }
示例#10
0
 public void Post([FromBody] CommentsDto dto, [FromServices] ICreateCommentCommand command)
 {
     executor.ExecuteCommand(command, dto);
 }