sharding/test/ShardingCore.Test50.MySql/DefaultDbContext.cs

32 lines
877 B
C#
Raw Normal View History

2021-08-15 07:32:50 +08:00
using Microsoft.EntityFrameworkCore;
using ShardingCore.DbContexts.ShardingDbContexts;
2021-08-20 23:10:34 +08:00
using ShardingCore.Sharding.Abstractions;
2021-08-15 07:32:50 +08:00
using ShardingCore.Test50.MySql.Domain.Maps;
namespace ShardingCore.Test50.MySql
{
/*
* @Author: xjm
* @Description:
* @Date: 2021/3/31 15:28:11
* @Ver: 1.0
* @Email: 326308290@qq.com
*/
public class DefaultDbContext : DbContext, IShardingTableDbContext
{
public DefaultDbContext(DbContextOptions<DefaultDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.ApplyConfiguration(new SysUserModMap());
modelBuilder.ApplyConfiguration(new SysUserSalaryMap());
}
public string ModelChangeKey { get; set; }
}
}