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); }
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; }