sharding/test/ShardingCore.Test/ShardingDefaultDbContext.cs

35 lines
1.1 KiB
C#
Raw Normal View History

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;
using ShardingCore.Test.Domain.Maps;
2021-11-09 10:51:18 +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)
{
}
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());
modelBuilder.ApplyConfiguration(new LogDayMap());
2021-11-25 14:00:01 +08:00
modelBuilder.ApplyConfiguration(new LogWeekDateTimeMap());
2021-11-09 10:51:18 +08:00
}
public IRouteTail RouteTail { get; set; }
}
}