Add AddAppServices method
This commit is contained in:
parent
a748846bdf
commit
75484f3f99
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -29,6 +29,7 @@ public class Startup
|
|||||||
.WithOptions(opt => opt.FromConfiguration(Configuration))
|
.WithOptions(opt => opt.FromConfiguration(Configuration))
|
||||||
.WithPolling(polling => polling.WithExceptionHandler<LoggingPollingExceptionHandler>()));
|
.WithPolling(polling => polling.WithExceptionHandler<LoggingPollingExceptionHandler>()));
|
||||||
services.AddTelegramBotHandling(typeof(BotClient).Assembly);
|
services.AddTelegramBotHandling(typeof(BotClient).Assembly);
|
||||||
|
services.AddAppServices();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Configure(IApplicationBuilder app)
|
public void Configure(IApplicationBuilder app)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user