修改方法名和方法

This commit is contained in:
xuejiaming 2021-12-10 11:23:31 +08:00
parent 91e2c3b678
commit 3a815b200b
2 changed files with 12 additions and 2 deletions

View File

@ -253,7 +253,7 @@ namespace ShardingCore.Bootstrapers
}
else
{
dbContext.RemoveDbContextAllRelationModelThatIsNoShardingTable();
dbContext.RemoveDbContextAllRelationModelThatIsNoSharding();
}
dbContext.Database.EnsureCreated();
dbContext.RemoveModelCache();

View File

@ -66,12 +66,22 @@ namespace ShardingCore.Extensions
}
#endif
}
/// <summary>
/// 移除所有的分表关系的模型
/// 移除所有的没有片的
/// </summary>
/// <param name="dbContext"></param>
[Obsolete($"plz use {nameof(RemoveDbContextAllRelationModelThatIsNoSharding)}")]
public static void RemoveDbContextAllRelationModelThatIsNoShardingTable(this DbContext dbContext)
{
RemoveDbContextAllRelationModelThatIsNoSharding(dbContext);
}
/// <summary>
/// 移除所有的没有分片的表
/// </summary>
/// <param name="dbContext"></param>
public static void RemoveDbContextAllRelationModelThatIsNoSharding(this DbContext dbContext)
{
#if EFCORE6
var contextModel = dbContext.GetService<IDesignTimeModel>().Model; ;