filmov
tv
Generating Pagination using Web API with example [For Beginners]

Показать описание
Use Pagination in Web API Design. Paging in a REST API. ASP.NET Core Web API.
CRUD operation using Web API (Http Call) in ASP.Net Core with Example :
(Affiliate Links)
----------------------------------------------------------------------------------------------------
👍Top 5 ASP.NET Core Courses :
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
👍Top 5 Web API Courses :
----------------------------------------------------------------------------------------------------
Here I am going to show how we can use pagination in Wep Api step by step Asp.Net Core
1. Create PagedList generic class.
2. Make constructor of PagedList Class.
3. Create a pagedList create method.
4. Create PaginationResourceParameters.
5. PaginationResourceParameters Done.
6. Create ResourceUriType Enum.
I want to apply my pagination on StudentWebApiController.
8. Create StudentResourceParameters class.
9. Create IStudentRepository.
13. Basic part is done. Create StudentsController and test our project.
14. Lets create CreateResourceUri method.
15. CreateResourceUri method done. Now I am going apply this method.
17. Ok done.
18. Now I am going to test this project. open postman for testing our GetStudents API.
19. I have already 50+ student entry in my database.
===============================================
✅ OTHER INFORMATION :
===============================================
----------------------------------------------------------------------------------------------------
Output :
20. So by default 10 students are showing as output.
21. pageSize = 5 means I want to show maximum 5 students in each page.
22. pageNumber = 1 means display page 1
23. Now I want to see next page's 5 students.
24. Now I want to see 10 students in my first page.
25. Want to see 10 students of my 3rd page.
26. So from header part you can get idea from x-pagination ==
totalCount:59,
pageSize:10,
currentPage:3,
totalPage:6,
previousPageLink:null,
nextPageLink:null
Thats all. Thanks for watching :)
If you like this video then please subscribe my channel and like this video.
Thank you. :)
#WebAPI #Pagination #ThumbIKR
CRUD operation using Web API (Http Call) in ASP.Net Core with Example :
(Affiliate Links)
----------------------------------------------------------------------------------------------------
👍Top 5 ASP.NET Core Courses :
----------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
👍Top 5 Web API Courses :
----------------------------------------------------------------------------------------------------
Here I am going to show how we can use pagination in Wep Api step by step Asp.Net Core
1. Create PagedList generic class.
2. Make constructor of PagedList Class.
3. Create a pagedList create method.
4. Create PaginationResourceParameters.
5. PaginationResourceParameters Done.
6. Create ResourceUriType Enum.
I want to apply my pagination on StudentWebApiController.
8. Create StudentResourceParameters class.
9. Create IStudentRepository.
13. Basic part is done. Create StudentsController and test our project.
14. Lets create CreateResourceUri method.
15. CreateResourceUri method done. Now I am going apply this method.
17. Ok done.
18. Now I am going to test this project. open postman for testing our GetStudents API.
19. I have already 50+ student entry in my database.
===============================================
✅ OTHER INFORMATION :
===============================================
----------------------------------------------------------------------------------------------------
Output :
20. So by default 10 students are showing as output.
21. pageSize = 5 means I want to show maximum 5 students in each page.
22. pageNumber = 1 means display page 1
23. Now I want to see next page's 5 students.
24. Now I want to see 10 students in my first page.
25. Want to see 10 students of my 3rd page.
26. So from header part you can get idea from x-pagination ==
totalCount:59,
pageSize:10,
currentPage:3,
totalPage:6,
previousPageLink:null,
nextPageLink:null
Thats all. Thanks for watching :)
If you like this video then please subscribe my channel and like this video.
Thank you. :)
#WebAPI #Pagination #ThumbIKR
Комментарии