2021-11-09 10:51:18 +08:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
using ShardingCore.Core.VirtualRoutes.TableRoutes.RouteTails.Abstractions;
|
|
|
|
|
using ShardingCore.Sharding;
|
|
|
|
|
using ShardingCore.Sharding.Abstractions;
|
2021-11-26 14:55:59 +08:00
|
|
|
|
using ShardingCore.Test.Domain.Maps;
|
2021-11-09 10:51:18 +08:00
|
|
|
|
|
2021-11-26 14:55:59 +08:00
|
|
|
|
namespace ShardingCore.Test
|
2021-11-09 10:51:18 +08:00
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* @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)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-31 23:33:26 +08:00
|
|
|
|
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
|
|
|
|
//{
|
|
|
|
|
// base.OnConfiguring(optionsBuilder);
|
|
|
|
|
// optionsBuilder.UseLazyLoadingProxies();
|
|
|
|
|
//}
|
|
|
|
|
|
2021-11-09 10:51:18 +08:00
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
|
modelBuilder.ApplyConfiguration(new SysUserModMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new SysUserSalaryMap());
|
2021-11-19 23:10:01 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new OrderMap());
|
2021-11-20 22:34:38 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new LogDayMap());
|
2021-11-25 14:00:01 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new LogWeekDateTimeMap());
|
2021-11-26 23:11:09 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new LogWeekTimeLongMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogYearDateTimeMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogNoShardingMap());
|
|
|
|
|
modelBuilder.ApplyConfiguration(new LogMonthLongMap());
|
2021-11-26 23:32:01 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new LogYearLongMap());
|
2021-11-27 09:51:46 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new SysUserModIntMap());
|
2021-11-27 21:27:30 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new LogDayLongMap());
|
2021-12-24 15:23:55 +08:00
|
|
|
|
modelBuilder.ApplyConfiguration(new MultiShardingOrderMap());
|
2021-11-09 10:51:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public IRouteTail RouteTail { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|