From 401c8d02aaf0e8b2059bab53fc62efd08f1d58f8 Mon Sep 17 00:00:00 2001 From: Rikitav Date: Sun, 8 Mar 2026 22:02:01 +0400 Subject: [PATCH] fixed double UseTelegrator invokation --- .../Hosting.Web/TelegramBotWebHost.cs | 1 - src/Telegrator.Hosting/Hosting/TelegramBotHost.cs | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHost.cs b/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHost.cs index ebd36c8..3517aa2 100644 --- a/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHost.cs +++ b/src/Telegrator.Hosting.Web/Hosting.Web/TelegramBotWebHost.cs @@ -53,7 +53,6 @@ namespace Telegrator.Hosting.Web { // Building proxy application _innerApp = webApplicationBuilder.Build(); - _innerApp.UseTelegratorWeb(); // Reruesting services for this host _updateRouter = Services.GetRequiredService(); diff --git a/src/Telegrator.Hosting/Hosting/TelegramBotHost.cs b/src/Telegrator.Hosting/Hosting/TelegramBotHost.cs index dadddcd..3151ada 100644 --- a/src/Telegrator.Hosting/Hosting/TelegramBotHost.cs +++ b/src/Telegrator.Hosting/Hosting/TelegramBotHost.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Telegrator.Core; @@ -12,14 +11,13 @@ namespace Telegrator.Hosting public class TelegramBotHost : IHost, ITelegratorBot { private readonly IHost _innerHost; - private readonly IServiceProvider _serviceProvider; private readonly IUpdateRouter _updateRouter; private readonly ILogger _logger; private bool _disposed; /// - public IServiceProvider Services => _serviceProvider; + public IServiceProvider Services => _innerHost.Services; /// public IUpdateRouter UpdateRouter => _updateRouter; @@ -40,8 +38,6 @@ namespace Telegrator.Hosting // Building proxy hoster _innerHost = hostApplicationBuilder.Build(); - _serviceProvider = _innerHost.Services; - _innerHost.UseTelegrator(); // Reruesting services for this host _updateRouter = Services.GetRequiredService();