Skip to content

Add PagingQueryableExtensions for Marten #8251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
s3w3nofficial opened this issue Apr 18, 2025 · 0 comments · May be fixed by #8260
Open

Add PagingQueryableExtensions for Marten #8251

s3w3nofficial opened this issue Apr 18, 2025 · 0 comments · May be fixed by #8260

Comments

@s3w3nofficial
Copy link

Product

Green Donut

Is your feature request related to a problem?

Currently there is no support for ToPageAsync extension method's when using Hotchocolate.Data.Marten.

Existing EntityFrameworkCore version

public class GetBrandQueryHandler(CatalogContext context)
    : IRequestHandler<GetBrandsQuery, Page<Brand>>
{
    public async Task<Page<Brand>> Handle(
        GetBrandsQuery request,
        CancellationToken cancellationToken)
        => await context.Brands
            .With(request.Query, s => s.AddAscending(t => t.Id))
            .ToPageAsync(request.PagingArguments, cancellationToken);
}

The solution you'd like

I would like to implement it so that it has the same signature as Hotchocolate.Data.EntityFrameworkCore.

Marten (not implemented)

public class GetBrandQueryHandler(IDocumentSession session)
    : IRequestHandler<GetBrandsQuery, Page<Brand>>
{
    public async Task<Page<Brand>> Handle(
        GetBrandsQuery request,
        CancellationToken cancellationToken)
        => await session.Query<Brand>()
            .With(request.Query, s => s.AddAscending(t => t.Id))
            .ToPageAsync(request.PagingArguments, cancellationToken);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant