-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathProgram.cs
More file actions
30 lines (28 loc) · 1.07 KB
/
Program.cs
File metadata and controls
30 lines (28 loc) · 1.07 KB
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
28
29
30
using Common;
using Data.Database;
using DataServices.Client;
using HealthChecks.Extensions;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Model;
using NHS.Screening.RetrieveParticipantData;
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.AddConfiguration<RetrieveParticipantDataConfig>(out RetrieveParticipantDataConfig config)
.AddDataServicesHandler()
.AddDataService<ParticipantManagement>(config.ParticipantManagementUrl)
.Build()
.ConfigureServices(services =>
{
services.AddSingleton<ICallFunction, CallFunction>();
services.AddSingleton<ICreateResponse, CreateResponse>();
services.AddSingleton<IDatabaseHelper, DatabaseHelper>();
services.AddSingleton<ICallFunction, CallFunction>();
services.AddSingleton<ICreateParticipant, CreateParticipant>();
// Register health checks
services.AddDatabaseHealthCheck("RetrieveParticipantData");
})
.AddDatabaseConnection()
.AddExceptionHandler()
.Build();
await host.RunAsync();