dncuug / X.PagedList

Library for easily paging through any IEnumerable/IQueryable in ASP.NET
https://nuget.org/packages/X.PagedList
MIT License
886 stars 213 forks source link

Remove fake async-over-sync extensions #262

Closed adschmu closed 2 months ago

adschmu commented 2 months ago

Using async-over-sync is generally considered bad practice and discouraged for libraries. It makes the user think he gets actual async behavior while the only thing he actually gets is the overhead of a useless Task.

Since we already have the proper behavior for IQueryable in the project X.PagedList.EF, users should either use sync methods or reference the named package for real async implementation.

There is absolutely no point in using the async-over-sync variants. This only makes things slower and blocks additional threads without providing any benefit at all.

Note that X.PagedList.EF does not yet have tests, but implementing async tests for proper IQueryable is a little bit more complicated than just wrapping IEnumerable. This should be done in a future commit.

adschmu commented 2 months ago

I updated this and put it on top of #268 and #269

If you want all three, just take this one and close the other two.