public override Task <Author> GetAuthorById(AuthorQuery request, ServerCallContext context) { return(Task.FromResult(new Author { Name = "2" })); }
public async Task <IList <AuthorAdminViewModel> > Handle(AuthorQuery request, CancellationToken cancellationToken) { var listAuthorMap = _mapper.Map <IList <AuthorAdminViewModel> > (await _context.Authors.Include(u => u.Books).ToListAsync(cancellationToken)); return(listAuthorMap); }
public async Task <IActionResult> Author(int authorId) { var query = new AuthorQuery(authorId); var queryResult = await _mediator.Send(query); var model = new AuthorViewModel() { Author = queryResult.Author }; return(View(model)); }
public async Task <ActionResult <AuthorQueryResponse> > Author([FromRoute] AuthorQuery query) { var result = await _queryBus.ExecuteAsync <AuthorQuery, AuthorQueryResponse>(query); return(Ok(result)); }
public GraphQLSandboxSchema(AuthorService authorService, IServiceProvider provider) : base(provider) { Query = new AuthorQuery(authorService); }