Add AddAppServices method

This commit is contained in:
Sergey Nazarov 2024-03-19 23:44:22 +04:00
parent a748846bdf
commit 75484f3f99
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
namespace Nocr.TelegramClient.AppServices;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddAppServices(this IServiceCollection services)
{
if (services == null)
throw new ArgumentNullException(nameof(services));
// Add registrations here
return services;
}
}

View File

@ -29,6 +29,7 @@ public class Startup
.WithOptions(opt => opt.FromConfiguration(Configuration))
.WithPolling(polling => polling.WithExceptionHandler<LoggingPollingExceptionHandler>()));
services.AddTelegramBotHandling(typeof(BotClient).Assembly);
services.AddAppServices();
}
public void Configure(IApplicationBuilder app)