希望分页中加入页数量(PageCount)属性,不用每次自己计算
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Start by locating the existing PagingInfo and BasePagingInfo types and the Page query entry point. Confirm how Count and PageSize are exposed, then add the requested PageCount behavior and verify it through the project’s existing pagination tests or query tests, if available.
Written by the indexing model from the issue text.
Description
问题点,好多分页控件需要的参数为 页大小 (PageCount)而不是 总数量(Count)导致我每次都需要自己去计算页大小,确实较麻烦。
希望将 PagingInfo 类加入到 FreeSql 中
public class PagingInfo : BasePagingInfo
{
public PagingInfo(int pageNumber, int pageSize = 20) : base()
{
base.PageNumber = pageNumber;
base.PageSize = pageSize;
}
/// <summary>
/// 页大小
/// </summary>
public int PageCount { get => Math.Max(1, (int)Math.Ceiling(Count / (double)PageSize)); }
}
使用方式
PagingInfo pagingInfo = new PagingInfo(PageIndex, PageSize);
DataList = await DataDb.db.Queryable<User>().Page(pagingInfo).ToListAsync();
PageCount = pagingInfo.PageCount;
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 910
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnetcore/FreeSql
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
dotnetcore/FreeSql#2078 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
dotnetcore/FreeSql#2280 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
dotnetcore/FreeSql#2279 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
dotnetcore/FreeSql#2278 ·
-
ACCESS数据库 BUG Open
Difficulty 3/5 1-2 days Newbie friendliness 58/100
dotnetcore/FreeSql#2276 ·
All issues in dotnetcore/FreeSql
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·