* hotfix of aspects inspection

* Added IHandlersManager. interface that allows both collecting and providing handlers
This commit is contained in:
2025-08-19 12:10:40 +04:00
parent 6905045cde
commit 92df5e9c79
9 changed files with 168 additions and 16 deletions
+9 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using System.Text;
@@ -159,7 +160,14 @@ namespace Telegrator.Hosting
services.AddSingleton<ITelegramBotHost>(this);
services.AddSingleton<ITelegratorBot>(this);
services.AddSingleton<IHandlersCollection>(handlers);
services.AddSingleton(handlers);
if (handlers is IHandlersManager manager)
{
services.RemoveAll<IHandlersProvider>();
services.AddSingleton<IHandlersProvider>(manager);
services.AddSingleton(manager);
}
}
}
}
+1 -1
View File
@@ -16,7 +16,7 @@
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Version>1.15.4</Version>
<Version>1.15.5</Version>
</PropertyGroup>
<ItemGroup>