JasperFx / marten

.NET Transactional Document DB and Event Store on PostgreSQL
https://martendb.io
MIT License
2.79k stars 441 forks source link

It seems that .ToPagedListAsync() could not be combined with a .Select when using Query<T> #3337

Closed kjbtech closed 1 month ago

kjbtech commented 1 month ago

Environment

Description

It seems that .ToPagedListAsync() could not be combined with a Select when using Query.

For example, when I'm using:

private readonly IDocumentSession _storage;

        var folders = await _storage.Query<Folder>()
            .Select(f => new InANutshellFolder()
            {
                OperationDate = f.ClassAction.OperationDate,
                FolderIdentifier = f.Id,
            })
            .ToListAsync();

versus:

var folders = await _storage.Query<Folder>()
            .Select(f => new InANutshellFolder()
            {
                OperationDate = f.ClassAction.OperationDate,
                FolderIdentifier = f.Id,
            })
            .ToPagedListAsync(1, 30);

In the last case, all my properties are null whereas the first one works well.

jeremydmiller commented 1 month ago

Got it. Fix will be in 7.26.1