public override async Task <GetBookChapterResponse> GetBookChapters(Empty request, ServerCallContext context)
    {
        var bookChapters = await _bookChapterService.GetAllAsync();

        GetBookChapterResponse response = new();

        response.Chapters.AddRange(bookChapters.Select(bc => bc.ToGRPCChapter()).ToArray());
        return(response);
    }
    public async Task <HttpResponseData> GetChaptersAsync(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = "chapters")] HttpRequestData req,
        FunctionContext executionContext)
    {
        var logger = executionContext.GetLogger("BooksService");

        logger.LogInformation("Function GetChapters invoked.");

        var response = req.CreateResponse(HttpStatusCode.OK);
        var chapters = _bookChapterService.GetAllAsync();
        await response.WriteAsJsonAsync(chapters);

        return(response);
    }
 public Task <IEnumerable <BookChapter> > GetBookChapters() =>
 _chapterService.GetAllAsync();
Beispiel #4
0
    public Task <IEnumerable <BookChapter> > GetBookChapters()
    {
        // HttpContext.VerifyUserHasAnyAcceptedScope(readScopesRequired);

        return(_chapterService.GetAllAsync());
    }