Files
juipnet/Host/ViewComponent/PagerViewComponent.cs

29 lines
696 B
C#
Raw Permalink Normal View History

2023-07-29 10:19:42 +08:00
using Hncore.Infrastructure.WebApi;
using Hncore.Pass.Vpn.Domain;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Threading.Tasks;
namespace ViewComponents
{
public class PagerModel
{
public int Total { get; set; }
public int PageSize { get; set; } = 50;
public int PageIndex { get; set; } = 1;
public string Param { get; set; }
public int TotalPage { get => (int)Math.Ceiling(this.Total / (this.PageSize * 1.0d)); }
}
public class PagerViewComponent: ViewComponent
{
public async Task<IViewComponentResult> InvokeAsync(PagerModel model)
{
return View(model);
}
}
}