- 修复 LoadSchemasAndNavigates ManyToMany 循环检测问题;

This commit is contained in:
2881099
2025-04-26 20:53:39 +08:00
parent 60b54ac471
commit c61e3f789d
3 changed files with 10 additions and 170 deletions

View File

@@ -292,17 +292,18 @@ ManyToMany 级联删除中间表(注意不删除外部根)
if (desc.Navigates?.Any() != true) return;
foreach(var nav in desc.Navigates)
{
if (nav.Type == TableDescriptor.NavigateType.ManyToMany && !string.IsNullOrWhiteSpace(nav.ManyToMany))
{
var midSchema = getSchemaHandler(nav.ManyToMany);
if (midSchema == null) throw new Exception($"{nameof(getSchemaHandler)}({nav.ManyToMany}) 返回值不能为 null");
if (returnSchemas.Any(a => a.Name == midSchema.Name)) continue;
returnSchemas.Add(midSchema);
}
if (returnSchemas.Any(a => a.Name == nav.RelTable)) continue;
var navSchema = getSchemaHandler(nav.RelTable);
if (navSchema == null) throw new Exception($"{nameof(getSchemaHandler)}({nav.RelTable}) 返回值不能为 null");
returnSchemas.Add(navSchema);
LocalEachNavigate(navSchema);
if (nav.Type == TableDescriptor.NavigateType.ManyToMany && !string.IsNullOrWhiteSpace(nav.ManyToMany))
{
var midSchema = getSchemaHandler(nav.ManyToMany);
if (midSchema == null) throw new Exception($"{nameof(getSchemaHandler)}({nav.ManyToMany}) 返回值不能为 null");
returnSchemas.Add(midSchema);
}
}
}
}