{"id":15783279,"url":"https://github.com/umairsyed613/un.entityframework.extensions.pagination","last_synced_at":"2026-05-01T09:32:10.527Z","repository":{"id":117067787,"uuid":"292804473","full_name":"umairsyed613/UN.EntityFramework.Extensions.Pagination","owner":"umairsyed613","description":"IQueryable extension for getting page data from database for web page view, or get paged data from pre populated list","archived":false,"fork":false,"pushed_at":"2020-09-08T13:23:07.000Z","size":5467,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-04T19:44:16.655Z","etag":null,"topics":["database","entity-framework","entity-framework-core","entityframeworkcore","generic","linq","page","pagedata","pagination","web-pagination"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/umairsyed613.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-04T09:17:02.000Z","updated_at":"2020-09-25T19:25:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"242b67d8-9cea-41dc-83e9-21b0d6969842","html_url":"https://github.com/umairsyed613/UN.EntityFramework.Extensions.Pagination","commit_stats":null,"previous_names":["umairsyed613/entityframework.extensions.pagination"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umairsyed613%2FUN.EntityFramework.Extensions.Pagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umairsyed613%2FUN.EntityFramework.Extensions.Pagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umairsyed613%2FUN.EntityFramework.Extensions.Pagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umairsyed613%2FUN.EntityFramework.Extensions.Pagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umairsyed613","download_url":"https://codeload.github.com/umairsyed613/UN.EntityFramework.Extensions.Pagination/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246500354,"owners_count":20787678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","entity-framework","entity-framework-core","entityframeworkcore","generic","linq","page","pagedata","pagination","web-pagination"],"created_at":"2024-10-04T19:41:02.492Z","updated_at":"2026-05-01T09:32:10.495Z","avatar_url":"https://github.com/umairsyed613.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UN.EntityFramework.Extensions.Pagination\nEntityFramework query extension for getting page data from database for views\n\n[![NuGet version](https://badge.fury.io/nu/UN.EntityFramework.Extensions.Pagination.png)](https://badge.fury.io/nu/UN.EntityFramework.Extensions.Pagination) ![Build and Publish](https://github.com/umairsyed613/UN.EntityFramework.Extensions.Pagination/workflows/Build%20and%20Publish/badge.svg) [![Nuget](https://img.shields.io/nuget/dt/UN.EntityFramework.Extensions.Pagination)](https://www.nuget.org/packages/UN.EntityFramework.Extensions.Pagination)\n\n### Getting started\n\nInstall the [UN.EntityFramework.Extensions.Pagination](https://www.nuget.org/packages/UN.EntityFramework.Extensions.Pagination/) package from NuGet:\n\n```powershell\nInstall-Package UN.EntityFramework.Extensions.Pagination\n```\n\n### Information\n\nTakePageResult method is the IQueryable\u003cT\u003e extension method. which adds the skip and take to your IQueryable Query. It can be used with your any generic list or entity framework query.\n\nPagedResult\u003cT\u003e is the generic class which have the 4 paramaters which you can use to return data its really up to you if you would want to use this class.\n\nIPageQuery is a interface which holds all the parameter required for pagination which must be passed in your query.\n\n\n\n### How it works\n\nExample 1\n```charp\npublic asyc Task\u003cPagedResult\u003cYourModel\u003e\u003e GetMyModelsByPage(IPageQuery pageQuery)\n{\n\tvar result = await dbcontext.Table\n                .TakePageResult(pageQuery).ToArrayAsync();\n\n\tvar totalItems = result.Count;\n\t\n    return new PagedResult\u003cYourModel\u003e\n    {\n        TotalItems = totalItems,\n        PageSize = pageQuery.PageSize,\n        PageNr = pageQuery.PageNr,\n        Result = result\n    };\n}\n```\n\nExample 2\nGet all the list of persons based on name from your database\n\n```csharp\npublic class MySearchQuery : IPageQuery\n{\n\tpublic string Name { get ; set ; }\t\n\tpublic int PageSize { get ; set ; }\n\tpublic int PageNr { get ; set ; }\n}\n\npublic asyc Task\u003cPagedResult\u003cPerson\u003e\u003e GetPersonsByNameAndPageResult(MySearchQuery searchQuery)\n{\n\tvar result = await dbcontext.Persons.Where(w =\u003e x.Name == searchQuery.Name)\n                .TakePageResult(searchQuery).ToArrayAsync();\n\n\tvar totalItems = result.Count;\n\t\n    return new PagedResult\u003cPerson\u003e\n    {\n        TotalItems = totalItems,\n        PageSize = searchQuery.PageSize,\n        PageNr = searchQuery.PageNr,\n        Result = result\n    };\n}\n\n```\n\n### Sample Running App\n\nFind the sample running application [here](https://github.com/umairsyed613/UN.EntityFramework.Extensions.Pagination/tree/master/Src/Samples/SampleBlazorWeb)\n\n![Sample](https://github.com/umairsyed613/UN.EntityFramework.Extensions.Pagination/blob/master/SampleRunningApp.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumairsyed613%2Fun.entityframework.extensions.pagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumairsyed613%2Fun.entityframework.extensions.pagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumairsyed613%2Fun.entityframework.extensions.pagination/lists"}