* hotfix of aspects inspection
* Added IHandlersManager. interface that allows both collecting and providing handlers
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user