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();