コード例 #1
0
 public CommentsController(IGetCommentsCommand searchCommentsCommand, IGetCommentCommand getOneCommentCommand, ICreateCommentCommand createCommentCommand, IEditCommentCommand editCommentCommand, IDeleteCommentCommand deleteCommentCommand, WebNewsContext context)
 {
     _searchCommentsCommand = searchCommentsCommand;
     _getOneCommentCommand  = getOneCommentCommand;
     _createCommentCommand  = createCommentCommand;
     _editCommentCommand    = editCommentCommand;
     _deleteCommentCommand  = deleteCommentCommand;
     _context = context;
 }
コード例 #2
0
 public CommentsController(Context context, IGetCommentsCommand getCommentsCommand, IGetCommentCommand getCommentCommand, IAddCommentCommand addCommentCommand, IEditCommentCommand editCommentCommand, IDeleteCommentCommand deleteCommentCommand)
 {
     _context              = context;
     _getCommentsCommand   = getCommentsCommand;
     _getCommentCommand    = getCommentCommand;
     _addCommentCommand    = addCommentCommand;
     _editCommentCommand   = editCommentCommand;
     _deleteCommentCommand = deleteCommentCommand;
 }
コード例 #3
0
 public CommentsController(UseCaseExecutor executor, IGetCommentsCommand getComments, IGetCommentCommand getComment, IAddCommentCommand addComment, IEditCommentCommand editComment, IDeleteCommentCommand deleteComment, IGetUsersCommand getUsers, IGetMoviesCommand getMovies)
 {
     this.executor      = executor;
     this.getComments   = getComments;
     this.getComment    = getComment;
     this.addComment    = addComment;
     this.editComment   = editComment;
     this.deleteComment = deleteComment;
     this.getUsers      = getUsers;
     this.getMovies     = getMovies;
 }
コード例 #4
0
 public CommentController(IGetNewsCommand getNewsCommand, IGetCommentsCommand getCommentsCommand, IGetCommentCommand getCommentCommand, IAddCommentCommand addComment, IDeleteCommentCommand deleteCommentCommand, IEditCommentCommand editCommentCommand, IEmailSender emailSender, NewsContext context, IHostingEnvironment hostingEnvironment)
 {
     _getNewsCommand       = getNewsCommand;
     _getCommentsCommand   = getCommentsCommand;
     _getCommentCommand    = getCommentCommand;
     _addComment           = addComment;
     _deleteCommentCommand = deleteCommentCommand;
     _editCommentCommand   = editCommentCommand;
     _emailSender          = emailSender;
     _context            = context;
     _hostingEnvironment = hostingEnvironment;
 }
コード例 #5
0
 public IActionResult Delete(int id, [FromServices] IDeleteCommentCommand command)
 {
     try
     {
         executor.ExecuteCommand(command, id);
         return(StatusCode(204, "Comment deleted"));
     }
     catch
     {
         return(StatusCode(422, "Fail"));
     }
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 public CommentsController(IGetCommentsCommand getCommand, IGetCommentCommand getOneCommand, IDeleteCommentCommand deleteCommand, IUpdateCommentCommand updateCommand, IAddCommentCommand addCommand)
 {
     _getCommand    = getCommand;
     _getOneCommand = getOneCommand;
     _deleteCommand = deleteCommand;
     _updateCommand = updateCommand;
     _addCommand    = addCommand;
 }
コード例 #8
0
 public ActionResult Delete(int id,
                            [FromServices] IDeleteCommentCommand command)
 {
     _executor.ExecuteCommand(command, id);
     return(NoContent());
 }
コード例 #9
0
 public CommentsController(ICreateCommentCommand createComment, IGetCommentsCommand getAll, IGetCommentCommand getOne, IEditCommentCommand editComment, IDeleteCommentCommand deleteComment)
 {
     _createComment = createComment;
     _getAll        = getAll;
     _getOne        = getOne;
     _editComment   = editComment;
     _deleteComment = deleteComment;
 }
コード例 #10
0
 public CommentsController(IGetCommentsCommand getCommentsCommand, IGetCommentCommand getCommentCommand, IAddCommentCommand addCommentCommand, IEditCommentCommand editCommentCommand, IDeleteCommentCommand deleteCommentCommand)
 {
     this.getCommentsCommand   = getCommentsCommand;
     this.getCommentCommand    = getCommentCommand;
     this.addCommentCommand    = addCommentCommand;
     this.editCommentCommand   = editCommentCommand;
     this.deleteCommentCommand = deleteCommentCommand;
 }
コード例 #11
0
 public CommentsController(IGetCommentsCommand getComments, IAddCommentCommand addComment, IGetCommentCommand getComment, IEditCommentCommand editComment, IDeleteCommentCommand deleteComment)
 {
     this.getComments   = getComments;
     this.addComment    = addComment;
     this.getComment    = getComment;
     this.editComment   = editComment;
     this.deleteComment = deleteComment;
 }
コード例 #12
0
 public IActionResult Delete(int id, [FromServices] IDeleteCommentCommand command)
 {
     executor.ExecuteCommand(command, id);
     return(StatusCode(StatusCodes.Status204NoContent));
 }
コード例 #13
0
 public CommentsController(IGetCommentsCommand getCommand, IGetCommentCommand getOneCommand, IAddCommentCommand addCommand, IEditCommentCommand editCommand, IDeleteCommentCommand deleteCommand)
 {
     _getCommand    = getCommand;
     _getOneCommand = getOneCommand;
     _addCommand    = addCommand;
     _editCommand   = editCommand;
     _deleteCommand = deleteCommand;
 }