mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-04 04:37:58 +08:00
synchronization
This commit is contained in:
parent
859d4cc78a
commit
7692ecf1fa
@ -48,6 +48,17 @@ namespace SqlSugar
|
||||
|
||||
public virtual void InitTables(Type entityType)
|
||||
{
|
||||
var splitTableAttribute = entityType.GetCustomAttribute<SplitTableAttribute>();
|
||||
if (splitTableAttribute != null)
|
||||
{
|
||||
var mappingInfo=this.Context.MappingTables.FirstOrDefault(it => it.EntityName == entityType.Name);
|
||||
if (mappingInfo == null)
|
||||
{
|
||||
this.Context.CodeFirst.SplitTables().InitTables(entityType);
|
||||
this.Context.MappingTables.RemoveAll(it=>it.EntityName==entityType.Name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//Prevent concurrent requests if used in your program
|
||||
lock (CodeFirstProvider.LockObject)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user