2021-11-29 08:38:33 +08:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using ShardingCore.Core.VirtualRoutes.TableRoutes.RouteTails.Abstractions;
|
|
|
|
|
using ShardingCore.Sharding;
|
|
|
|
|
using ShardingCore.Sharding.Abstractions;
|
|
|
|
|
using ShardingCore.Test3x.Domain.Maps;
|
|
|
|
|
|
|
|
|
|
namespace ShardingCore.Test3x
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* @Author: xjm
|
|
|
|
|
* @Description:
|
|
|
|
|
* @Date: 2021/8/15 10:21:03
|
|
|
|
|
* @Ver: 1.0
|
|
|
|
|
* @Email: 326308290@qq.com
|
|
|
|
|
*/
|
|
|
|
|
public class ShardingDefaultDbContext:AbstractShardingDbContext, IShardingTableDbContext
|
|
|
|
|
{
|
|
|
|
|
public ShardingDefaultDbContext(DbContextOptions<ShardingDefaultDbContext> options) : base(options)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
|
modelBuilder.ApplyConfiguration(new SysUserModMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new SysUserSalaryMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new OrderMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogDayMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogWeekDateTimeMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogWeekTimeLongMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogYearDateTimeMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogNoShardingMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogMonthLongMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogYearLongMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new SysUserModIntMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogDayLongMap());
|
2021-12-24 15:23:55 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new MultiShardingOrderMap());
|
2021-11-29 08:38:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IRouteTail RouteTail { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|