-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
28 lines (25 loc) · 966 Bytes
/
Program.cs
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
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using AirlineSendAgent.App;
using AirlineSendAgent.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using AirlineSendAgent.Client;
namespace AirlineSendAgent
{
class Program
{
static void Main(string[] args)
{
var host= Host.CreateDefaultBuilder()
.ConfigureServices((context,services) =>{
services.AddSingleton<IntAppHost,AppHost>();
services.AddSingleton<IntWebhookClient,WebhookClient>();
services.AddDbContext<SendAgentDbContext>(opt => opt.UseSqlServer(context.Configuration.GetConnectionString("AirlineConnection")));
services.AddHttpClient();
}).Build();
host.Services.GetService<IntAppHost>().Run();
}
}
}