* Renamed "concurrency" parameters in handlers attributes to more relevant and intuitive "importance" parameter

* Added debug logging helper that use default Debug tracer to trace filter, providers, routers and pool execution
* Added debug logging for failing during handlers resolving, filters
* Added new "CreateEmptyBuilder" methods for TelegramBotHost class
* Addede ability to name handlers using "DisplayNameAttribute". This name is writed to descriptor's "DisplayString" property
* Fixed missing summaries inside Hosting library
This commit is contained in:
2025-07-26 00:01:46 +04:00
parent bcdce52a37
commit cec7c88b6a
42 changed files with 647 additions and 102 deletions
+8 -3
View File
@@ -14,6 +14,9 @@ using Telegrator.MadiatorCore;
#pragma warning disable IDE0001
namespace Telegrator.Hosting
{
/// <summary>
/// Represents a hosted telegram bots and services builder that helps manage configuration, logging, lifetime, and more.
/// </summary>
public class TelegramBotHostBuilder : ITelegramBotHostBuilder
{
private readonly HostApplicationBuilder _innerBuilder;
@@ -38,10 +41,12 @@ namespace Telegrator.Hosting
/// <summary>
/// Initializes a new instance of the <see cref="TelegramBotHostBuilder"/> class.
/// </summary>
internal TelegramBotHostBuilder(TelegramBotHostBuilderSettings? settings = null)
/// <param name="hostApplicationBuilder"></param>
/// <param name="settings"></param>
internal TelegramBotHostBuilder(HostApplicationBuilder hostApplicationBuilder, TelegramBotHostBuilderSettings? settings = null)
{
_innerBuilder = hostApplicationBuilder;
_settings = settings ?? new TelegramBotHostBuilderSettings();
_innerBuilder = new HostApplicationBuilder(settings?.ToApplicationBuilderSettings());
_handlers = new HostHandlersCollection(Services, _settings);
Services.Configure<TelegramBotOptions>(Configuration.GetSection(nameof(TelegramBotOptions)));
@@ -55,7 +60,7 @@ namespace Telegrator.Hosting
/// <returns></returns>
public TelegramBotHost Build()
{
foreach (var preBuildRoutine in _handlers.PreBuilderRoutines)
foreach (PreBuildingRoutine preBuildRoutine in _handlers.PreBuilderRoutines)
{
try
{