-
Notifications
You must be signed in to change notification settings - Fork 1
Paging
Hamed ZVand edited this page Nov 4, 2019
·
2 revisions
Paging infrastructures and extensions in Alamut.Data help you to divides the items in discrete pages.
-
IPaginatedCriteria
provides criteria data-structure as an ipute for Paginated method. -
IPaginated<T>
provides result ofPaginated
method that include the information of Paging and wrapped the return data.
-
IPaginated<T> ToPaginated<T>(this IQueryable<T> query, IPaginatedCriteria paginatedCriteria)
gets anIPaginatedCriteria
and return paginated data inIPaginated<T>
-
async Task<IPaginated<T>> ToPaginatedAsync<T>(this IQueryable<T> query, paginatedCriteria)
async gets anIPaginatedCriteria
and return paginated data inIPaginated<T>
IPaginated<Blog> actual = await _dbContext.Blogs.ToPaginatedAsync(new PaginatedCriteria(2, 10));
foreach(var blogItem in actual.Data)
{ Console.WriteLine(blogItem.Id); }
It's worth to take a look at test scenarios