- tweak: fix resolving think

This commit is contained in:
2025-01-07 17:01:00 +03:00
parent 8619e248fd
commit 99312d38a8
12 changed files with 286 additions and 105 deletions

View File

@@ -7,8 +7,17 @@ public static class ServiceExt
{
public static void AddServices(this IServiceCollection services)
{
foreach (var (type, inference) in GetServicesWithHelpAttribute(Assembly.GetExecutingAssembly()))
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies())
{
AddServices(services, assembly);
}
}
public static void AddServices(this IServiceCollection services, Assembly assembly)
{
foreach (var (type, inference) in GetServicesWithHelpAttribute(assembly))
{
Console.WriteLine("[ServiceMng] ADD SERVICE " + type);
if (inference is null)
{
services.AddSingleton(type);