From 75484f3f99c2d6c68bee46bddfd83b008bf80f73 Mon Sep 17 00:00:00 2001 From: Sergey Nazarov Date: Tue, 19 Mar 2024 23:44:22 +0400 Subject: [PATCH] Add AddAppServices method --- .../ServiceCollectionExtensions.cs | 16 ++++++++++++++++ .../Infrastructure/Startup.cs | 1 + 2 files changed, 17 insertions(+) create mode 100644 src/Nocr.TelegramClient.AppServices/ServiceCollectionExtensions.cs diff --git a/src/Nocr.TelegramClient.AppServices/ServiceCollectionExtensions.cs b/src/Nocr.TelegramClient.AppServices/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..6913c9a --- /dev/null +++ b/src/Nocr.TelegramClient.AppServices/ServiceCollectionExtensions.cs @@ -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; + } +} \ No newline at end of file diff --git a/src/Nocr.TelegramClient.Host/Infrastructure/Startup.cs b/src/Nocr.TelegramClient.Host/Infrastructure/Startup.cs index fa4ee6c..1f04501 100644 --- a/src/Nocr.TelegramClient.Host/Infrastructure/Startup.cs +++ b/src/Nocr.TelegramClient.Host/Infrastructure/Startup.cs @@ -29,6 +29,7 @@ public class Startup .WithOptions(opt => opt.FromConfiguration(Configuration)) .WithPolling(polling => polling.WithExceptionHandler())); services.AddTelegramBotHandling(typeof(BotClient).Assembly); + services.AddAppServices(); } public void Configure(IApplicationBuilder app)