diff --git a/src/Telegrator.Hosting.Web/TypesExtensions.cs b/src/Telegrator.Hosting.Web/TypesExtensions.cs
index d4ff7e1..b4676a3 100644
--- a/src/Telegrator.Hosting.Web/TypesExtensions.cs
+++ b/src/Telegrator.Hosting.Web/TypesExtensions.cs
@@ -27,20 +27,6 @@ namespace Telegrator
///
public const string HandlersCollectionPropertyKey = nameof(IHandlersCollection);
- extension(WebApplicationBuilder builder)
- {
- ///
- /// Gets the from the builder properties.
- ///
- public IHandlersCollection Handlers
- {
- get
- {
- return (IHandlersCollection)builder.Host.Properties[HandlersCollectionPropertyKey];
- }
- }
- }
-
///
/// Replaces TelegramBotWebHostBuilder. Configures DI, options, and handlers.
///
@@ -60,7 +46,7 @@ namespace Telegrator
public static IHostApplicationBuilder AddTelegratorWeb(this WebApplicationBuilder builder, TelegratorOptions? options = null, IHandlersCollection? handlers = null, Action? action = null)
{
AddTelegratorWebInternal(builder.Services, builder.Configuration, ((IHostApplicationBuilder)builder).Properties, ref handlers, options);
- action?.Invoke(new TelegramBotWebHostBuilder(builder));
+ action?.Invoke(new TelegramBotWebHostBuilder(builder, handlers));
return builder;
}
diff --git a/src/Telegrator.Hosting/TypesExtensions.cs b/src/Telegrator.Hosting/TypesExtensions.cs
index e9ae080..0e5294a 100644
--- a/src/Telegrator.Hosting/TypesExtensions.cs
+++ b/src/Telegrator.Hosting/TypesExtensions.cs
@@ -31,20 +31,6 @@ public static class HostBuilderExtensions
///
public const string HandlersCollectionPropertyKey = nameof(IHandlersCollection);
- extension (HostApplicationBuilder builder)
- {
- ///
- /// Gets the from the builder properties.
- ///
- public IHandlersCollection Handlers
- {
- get
- {
- return (IHandlersCollection)((IHostApplicationBuilder)builder).Properties[HandlersCollectionPropertyKey];
- }
- }
- }
-
///
/// Replaces TelegramBotHostBuilder. Configures DI, options, and handlers.
///