Esempio n. 1
0
        public async Task <IActionResult> Delete([Required] int postId,
                                                 [FromServices] IRemovePostUseCase useCase)
        {
            useCase.SetOutputPort(this);

            var userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;

            await useCase.ExecuteAsync(userId, postId)
            .ConfigureAwait(false);

            return(_viewModel);
        }
Esempio n. 2
0
 public PostController(
     IAddPostUseCase addPostUseCase,
     IRemovePostUseCase removePostUseCase,
     IUpdatePostUseCase updatePostUseCase,
     IGetAllPostUseCase getAllPostUseCase,
     IGetByIdPostUseCase getByIdPostUseCase,
     IGetByIdTopicUseCase getByIdTopicUseCase,
     IGetByIdUserUseCase getByIdUserUseCase)
 {
     this.addPostUseCase      = addPostUseCase;
     this.removePostUseCase   = removePostUseCase;
     this.updatePostUseCase   = updatePostUseCase;
     this.getAllPostUseCase   = getAllPostUseCase;
     this.getByIdPostUseCase  = getByIdPostUseCase;
     this.getByIdTopicUseCase = getByIdTopicUseCase;
     this.getByIdUserUseCase  = getByIdUserUseCase;
 }