-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
25 lines (20 loc) · 767 Bytes
/
Program.cs
File metadata and controls
25 lines (20 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using ReSchedule;
var host = new HostBuilder()
.ConfigureServices(services =>
{
var logger = services.FirstOrDefault(s => s.ServiceType == typeof(ILogger<>));
if (logger != null)
services.Remove(logger);
services.Add(new ServiceDescriptor(typeof(ILogger<>), typeof(FunctionsLogger<>), ServiceLifetime.Transient));
services.AddMemoryCache();
services.AddHttpClient();
services.AddSingleton<ChatStorageClient>();
services.AddSingleton<ApiClient>();
services.AddSingleton<Bot>();
})
.ConfigureFunctionsWorkerDefaults()
.Build();
host.Run();