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