Exemple #1
0
        public async Task <IActionResult> GetIssueById(int libraryId, int periodicalId, int volumeNumber, int issueNumber, CancellationToken token = default(CancellationToken))
        {
            var query  = new GetIssueByIdQuery(libraryId, periodicalId, volumeNumber, issueNumber);
            var issues = await _queryProcessor.ExecuteAsync(query, cancellationToken : token);

            if (issues != null)
            {
                return(new OkObjectResult(_issueRenderer.Render(issues, libraryId)));
            }

            return(new NotFoundResult());
        }
Exemple #2
0
        public async Task <ActionResult <IssueDTO> > GetById(int issueId, CancellationToken cancellationToken)
        {
            var query = new GetIssueByIdQuery(issueId);

            return(await _mediator.Send(query, cancellationToken));
        }