Paging in ASP.NET Core Web API

preview_player
Показать описание

In this video, we are going to learn how to create Paging functionality in ASP.NET Core Web API. We are going to show the initial implementation, apply the pagination, and then show you how to improve even more the solution.

LINKS MENTIONED IN THE VIDEO:
To visit the whole article and download the source code visit:
To learn more about the ASP.NET Core Web API development, visit:
To watch the repository pattern video, visit:
To visit our site:

FOLLOW US ON SOCIAL MEDIA!

VIDEO SUMMARY:
In this video, we’re going to learn how to implement paging in ASP.NET Core Web API. Paging (pagination) is one of the most important concepts in building RESTful APIs.

As a matter of fact, we don’t want to return a collection of all resources when querying our API. That can cause performance issues and it’s in no way optimized for public or private APIs. It can cause massive slowdowns and even application crashes in severe cases.

The source code for this video can be found on the GitHub repo. If you want to follow along with the article, you can use the start branch and if you want to get the final solution or if you get stuck, switch to the end branch.

NOTE: Some degree of previous knowledge is needed to follow this article. It relies heavily on the ASP.NET Core Web API series on Code Maze, so if you are not sure how to set up the database or how the underlying architecture works, we strongly suggest you go through the series.

What is Paging?

Paging refers to getting partial results from an API. Imagine having millions of results in the database and having your application try to return all of them at once.

Not only that would be an extremely ineffective way of returning the results, but it could also possibly have devastating effects on the application itself or the hardware it runs on. Moreover, every client has limited memory resources and it needs to restrict the number of shown results.

Thus, we need a way to return a set number of results to the client to avoid these consequences.

Let’s see how we can do that.
We’ll discuss what paging is, the easiest way to implement it, and then improve on that solution some more to create a more readable and flexible codebase.
Рекомендации по теме
Комментарии
Автор

Thank you all for watching and for your support.

CodeMaze
Автор

I love your examples because they are so real. Not a foo, bar, baz thing (nobody should write this way). I improved a lot the cleanliness of my code with your books, articles and videos. I specially appreciate the videos

PorkopekPeres
Автор

East & West @CodeMaze is Best. ....!

iswaqasahmed
Автор

Very good video and well taught! I will consider buying your book this month and I'll be sure to check out the video course you mentioned in the other comments as soon as it's completed.

Robd
Автор

Once again, video was awesome. It helped me a lot in not only implementing the pagination, but it also taught me a few new coding techniques that allowed me to go back to my current code and make it better. Best Regards

Robd
Автор

Best blog ever...
I`m backing develop in .NET after 3 Years .
Will buy the book. thanks for this amazing blog.

FabioGomesCG
Автор

Excellent video, great coding style. Thank you.

gralexp
Автор

Just will change pagination in my job tomorrow based on your solution :D

Time
Автор

Great videos and blog, i also bought Asp net core Book, But my suggestion is to make a asp net core project from scratch and will have complete project, includes all the topics like automappers, pagination, filters, validation, security etc, so its easy to leran from there...but you guys always rock..thanks very much

RAM-ffdy
Автор

Great Content and information! Would like to see more content but I really think the sound volume could be a bit higher.

VMTechnologies
Автор

How is the RequestParameters supposed to be changed by the heir? Let's say I want to change the MaxPageSize to get a product. What should I do for this?

Famouse
Автор

In Pagedlist class AddRange(Items) . what is Addrange method can show it ?

amitesh
Автор

I have one question. What we are doing invoking addRange(item) we add this items to class, where we added this items?

praktycznewskazowki
Автор

In case of obtaining a dynamic list (List<dynamic>), how would you proceed to paginate?

marcosguerrero
Автор

Hello
I can not access to "Response headers
" in rxjs.
Can you help me to get x_paging in rxjs 6.6?

HoseinHomayoni
Автор

So do I can take the value of X-pagnition in Front end

mersy
visit shbcf.ru