-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
38 lines (32 loc) · 1.12 KB
/
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
29
30
31
32
33
34
35
36
37
38
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using HiddenMickey.Models;
using HiddenMickey.Utils;
namespace HiddenMickey
{
public class Program
{
public static async Task Main(string[] args)
{
var host = Utilities.CreateWebHostBuilder(args).Build();
using (var scope = host.Services.CreateScope())
{
var context = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
var canContinue = await Utilities.WaitForMigrations(host, context);
if (!canContinue)
{
return;
}
}
var task = host.RunAsync();
Utilities.Notify("HiddenMickey Running!");
Console.WriteLine("You must also have the ClientApp running. In a separate terminal, run:");
Console.WriteLine(" cd ClientApp");
Console.WriteLine(" npm start");
WebHostExtensions.WaitForShutdown(host);
}
}
}