2022-07-20 13:44:52 +08:00
|
|
|
using ShardingCore.Core.EntityMetadatas;
|
|
|
|
using ShardingCore.VirtualRoutes.Mods;
|
|
|
|
|
|
|
|
namespace Sample.MySql.multi;
|
|
|
|
|
|
|
|
public class MyUserRoute:AbstractSimpleShardingModKeyStringVirtualTableRoute<MyUser>
|
|
|
|
{
|
2022-08-30 10:25:01 +08:00
|
|
|
protected override bool EnableHintRoute => true;
|
|
|
|
|
2022-07-20 13:44:52 +08:00
|
|
|
public MyUserRoute() : base(1, 3)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public override void Configure(EntityMetadataTableBuilder<MyUser> builder)
|
|
|
|
{
|
|
|
|
builder.ShardingProperty(o => o.Id);
|
|
|
|
}
|
|
|
|
}
|