add support for Dynamic Entity Registration in DbContext by Provides IXEntityRegisterar interface and XBaseEntityRegisterar as an abstract Implementation ...

all other requirements handled inside Module.
This commit is contained in:
2026-05-26 22:06:38 +03:30
parent 3d274c347f
commit 1dbda46d4c
8 changed files with 474 additions and 8 deletions
+38
View File
@@ -1,4 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using GraphQL;
using GraphQL.Server;
using GraphQL.Server.Ui.Playground;
@@ -1245,6 +1248,41 @@ namespace xDataService.Helpers
}
#endregion
//
#region Entity Assembly Detector ...
/// <summary>
/// Extract Assemblies which Contains Entity ...
/// </summary>
/// <returns></returns>
public static List<Assembly> ExtractEntityAssemblies()
{
//
var result = new List<Assembly>();
//
var allAssemblies = AppDomain.CurrentDomain.GetAssemblies();
foreach (var assembly in allAssemblies)
{
//
try
{
//
bool hasEntity = assembly
.GetExportedTypes()
.Any(t => t.IsXEntity());
if (hasEntity)
{
result.Add(assembly);
}
}
catch { }
}
//
return result;
}
#endregion
//
#region Private ...
/// <summary>