* Fixed wrong UseTelegrator method using in web host
* Fixed HostedUpdateWebhooker service discovery
This commit is contained in:
@@ -94,7 +94,7 @@ public class TelegramBotWebHostBuilder : ITelegramBotHostBuilder
|
|||||||
public TelegramBotWebHost Build()
|
public TelegramBotWebHost Build()
|
||||||
{
|
{
|
||||||
TelegramBotWebHost host = new TelegramBotWebHost(_innerBuilder);
|
TelegramBotWebHost host = new TelegramBotWebHost(_innerBuilder);
|
||||||
host.UseTelegrator();
|
host.UseTelegratorWeb();
|
||||||
return host;
|
return host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||||
|
|
||||||
<Title>Telegrator.Hosting.Web</Title>
|
<Title>Telegrator.Hosting.Web</Title>
|
||||||
<Version>1.16.6</Version>
|
<Version>1.16.7</Version>
|
||||||
<Authors>Rikitav Tim4ik</Authors>
|
<Authors>Rikitav Tim4ik</Authors>
|
||||||
<Company>Rikitav Tim4ik</Company>
|
<Company>Rikitav Tim4ik</Company>
|
||||||
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
||||||
|
|||||||
@@ -126,7 +126,9 @@ namespace Telegrator
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static T UseTelegratorWeb<T>(this T app) where T : IEndpointRouteBuilder, IHost
|
public static T UseTelegratorWeb<T>(this T app) where T : IEndpointRouteBuilder, IHost
|
||||||
{
|
{
|
||||||
HostedUpdateWebhooker webhooker = app.ServiceProvider.GetRequiredService<HostedUpdateWebhooker>();
|
if (app.ServiceProvider.GetServices<IHostedService>().FirstOrDefault(s => s is HostedUpdateWebhooker) is not HostedUpdateWebhooker webhooker)
|
||||||
|
throw new InvalidOperationException("No service for type 'Telegrator.Mediation.HostedUpdateWebhooker' has been registered.");
|
||||||
|
|
||||||
ITelegramBotInfo info = app.ServiceProvider.GetRequiredService<ITelegramBotInfo>();
|
ITelegramBotInfo info = app.ServiceProvider.GetRequiredService<ITelegramBotInfo>();
|
||||||
IHandlersCollection handlers = app.ServiceProvider.GetRequiredService<IHandlersCollection>();
|
IHandlersCollection handlers = app.ServiceProvider.GetRequiredService<IHandlersCollection>();
|
||||||
ILoggerFactory loggerFactory = app.ServiceProvider.GetRequiredService<ILoggerFactory>();
|
ILoggerFactory loggerFactory = app.ServiceProvider.GetRequiredService<ILoggerFactory>();
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||||
|
|
||||||
<Title>Telegrator.Hosting</Title>
|
<Title>Telegrator.Hosting</Title>
|
||||||
<Version>1.16.6</Version>
|
<Version>1.16.7</Version>
|
||||||
<Authors>Rikitav Tim4ik</Authors>
|
<Authors>Rikitav Tim4ik</Authors>
|
||||||
<Company>Rikitav Tim4ik</Company>
|
<Company>Rikitav Tim4ik</Company>
|
||||||
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
|
||||||
|
|
||||||
<Title>Telegrator : Telegram.Bot mediator framework</Title>
|
<Title>Telegrator : Telegram.Bot mediator framework</Title>
|
||||||
<Version>1.16.6</Version>
|
<Version>1.16.7</Version>
|
||||||
<Authors>Rikitav Tim4ik</Authors>
|
<Authors>Rikitav Tim4ik</Authors>
|
||||||
<Company>Rikitav Tim4ik</Company>
|
<Company>Rikitav Tim4ik</Company>
|
||||||
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
<RepositoryUrl>https://github.com/Rikitav/Telegrator</RepositoryUrl>
|
||||||
|
|||||||
Reference in New Issue
Block a user