namespace Milimoe.FunGame.Core.Api.Utility { public static class LINQExtension { public static IEnumerable GetPage(this IEnumerable list, int showPage, int pageSize) { return [.. list.Skip((showPage - 1) * pageSize).Take(pageSize)]; } public static int MaxPage(this IEnumerable list, int pageSize) { if (pageSize <= 0) pageSize = 1; int page = (int)Math.Ceiling((double)list.Count() / pageSize); return page > 0 ? page : 1; } } }