Skip to content
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

Extension method "Select" is only usable on concrete PagedList class #112

Closed
UncleDave opened this issue Apr 23, 2018 · 0 comments

Comments

@UncleDave
Copy link
Contributor

commented Apr 23, 2018

The current signature of the "Select" extension method is:

IPagedList<TResult> Select<TSource, TResult>(this PagedList<TSource> source, Func<TSource, TResult> selector)

As this is an extension of PagedList<T> rather than IPagedList<T> it is not visible as an extension method for the interface.

Meaning the following code compiles but results in IEnumerable<T> rather than the desired IPagedList<T>.

var pagedList = queryable.ToPagedList(pageNumber, pageSize).Select(x => x.SomeProperty);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.