From ac769e656b122ff569c3f1534701b71e00fed586 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 27 Oct 2020 19:21:35 +0800 Subject: Split front and back end. --- Timeline/Program.cs | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 Timeline/Program.cs (limited to 'Timeline/Program.cs') diff --git a/Timeline/Program.cs b/Timeline/Program.cs deleted file mode 100644 index 87e330a2..00000000 --- a/Timeline/Program.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using System.Resources; -using Timeline.Entities; -using Timeline.Services; - -[assembly: NeutralResourcesLanguage("en")] - -namespace Timeline -{ - public static class Program - { - public static void Main(string[] args) - { - var host = CreateWebHostBuilder(args).Build(); - - var env = host.Services.GetRequiredService(); - - var databaseBackupService = host.Services.GetRequiredService(); - databaseBackupService.BackupNow(); - - if (env.IsProduction()) - { - using (var scope = host.Services.CreateScope()) - { - var databaseContext = scope.ServiceProvider.GetRequiredService(); - databaseContext.Database.Migrate(); - } - } - - host.Run(); - } - - public static IHostBuilder CreateWebHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); - } -} -- cgit v1.2.3