sharding/samples/Sample.SqlServer/Shardings/SysUserSalaryPaginationConf...

28 lines
1.2 KiB
C#
Raw Permalink Normal View History

2021-09-03 16:00:12 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Sample.SqlServer.Domain.Entities;
using ShardingCore.Sharding.PaginationConfigurations;
namespace Sample.SqlServer.Shardings
{
public class SysUserSalaryPaginationConfiguration:IPaginationConfiguration<SysUserSalary>
{
public void Configure(PaginationBuilder<SysUserSalary> builder)
{
2021-09-03 21:23:26 +08:00
builder.PaginationSequence(o => o.Id)
2021-09-22 17:29:59 +08:00
.UseRouteComparer(Comparer<string>.Default)
2021-09-03 21:23:26 +08:00
.UseQueryMatch(PaginationMatchEnum.Owner | PaginationMatchEnum.Named | PaginationMatchEnum.PrimaryMatch);
2022-06-02 12:25:26 +08:00
//设置当
2021-09-03 21:23:26 +08:00
builder.PaginationSequence(o => o.DateOfMonth)
2022-06-02 12:25:26 +08:00
.UseRouteComparer(Comparer<string>.Default)
2021-09-03 22:40:22 +08:00
.UseQueryMatch(PaginationMatchEnum.Owner | PaginationMatchEnum.Named | PaginationMatchEnum.PrimaryMatch).UseAppendIfOrderNone(10);
2021-09-03 21:23:26 +08:00
builder.PaginationSequence(o => o.Salary)
2022-06-02 12:25:26 +08:00
.UseRouteComparer(Comparer<string>.Default)
2021-09-03 21:23:26 +08:00
.UseQueryMatch(PaginationMatchEnum.Owner | PaginationMatchEnum.Named | PaginationMatchEnum.PrimaryMatch).UseAppendIfOrderNone();
2021-09-03 22:40:22 +08:00
builder.ConfigReverseShardingPage(0.5d,10000L);
2021-09-03 16:00:12 +08:00
}
}
}