NPoco icon indicating copy to clipboard operation
NPoco copied to clipboard

Combine ToPage with ProjectTo

Open PeterN opened this issue 5 years ago • 2 comments

Whilst making heavy use of ToPageAsync(), most of the time I only need a cut-down list of fields from the model. I use ProjectToAsync() in other places where I'm not after a paged list.

Currently I work around this by having a cut-down version of the model with only the required fields, but that results in code duplication and means it's not possible to filter on a field that isn't in the cut-down model.

So is a combined "ToProjectedPage" something that is possible?

Thanks!

PeterN avatar Jan 08 '21 08:01 PeterN

Yeh its possible I believe as Limit already works with projections.

schotime avatar Jan 08 '21 11:01 schotime

This would be really useful, is this enhancement likely to be accepted soon?

79it avatar Aug 04 '22 14:08 79it