-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
27 lines (25 loc) · 944 Bytes
/
Program.cs
File metadata and controls
27 lines (25 loc) · 944 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
26
27
using Common;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Data.Database;
using Model;
using DataServices.Client;
using NHS.Screening.DemographicDurableFunction;
using HealthChecks.Extensions;
var host = new HostBuilder()
.AddConfiguration<DemographicDurableFunctionConfig>(out DemographicDurableFunctionConfig config)
.AddDataServicesHandler()
.AddDataService<ParticipantDemographic>(config.DemographicDataServiceURL)
.Build()
.ConfigureFunctionsWebApplication()
.ConfigureServices(services =>
{
services.AddSingleton<ICreateResponse, CreateResponse>();
services.AddTransient<IDatabaseHelper, DatabaseHelper>();
// Register health checks
services.AddDatabaseHealthCheck("DurableDemographicFunction");
})
.AddExceptionHandler()
.AddDatabaseConnection()
.Build();
await host.RunAsync();