diff options
author | crupest <crupest@outlook.com> | 2021-04-23 17:28:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2021-04-23 17:37:37 +0800 |
commit | 6e067a28d8527726a2a17045bef0f0e3d3430ed5 (patch) | |
tree | 967ed4c84981d6b626a3370c726d35d1c3e2c2b4 /BackEnd/Timeline/Program.cs | |
parent | 6acef36dc717834605eda2af9e1738dac8fa2f6d (diff) | |
download | timeline-6e067a28d8527726a2a17045bef0f0e3d3430ed5.tar.gz timeline-6e067a28d8527726a2a17045bef0f0e3d3430ed5.tar.bz2 timeline-6e067a28d8527726a2a17045bef0f0e3d3430ed5.zip |
refactor: Refactor a lot.
Diffstat (limited to 'BackEnd/Timeline/Program.cs')
-rw-r--r-- | BackEnd/Timeline/Program.cs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/BackEnd/Timeline/Program.cs b/BackEnd/Timeline/Program.cs index 19fa6e37..e16c27c5 100644 --- a/BackEnd/Timeline/Program.cs +++ b/BackEnd/Timeline/Program.cs @@ -7,7 +7,7 @@ using System.Resources; using System.Threading.Tasks;
using Timeline.Entities;
using Timeline.Services;
-using Timeline.Services.Migration;
+using Timeline.Services.DatabaseManagement;
[assembly: NeutralResourcesLanguage("en")]
@@ -19,18 +19,7 @@ namespace Timeline {
var host = CreateWebHostBuilder(args).Build();
- var databaseBackupService = host.Services.GetRequiredService<IDatabaseBackupService>();
- databaseBackupService.BackupNow();
-
- using (var scope = host.Services.CreateScope())
- {
- var databaseContext = scope.ServiceProvider.GetRequiredService<DatabaseContext>();
- await databaseContext.Database.MigrateAsync();
- var customMigrationManager = scope.ServiceProvider.GetRequiredService<ICustomMigrationManager>();
- await customMigrationManager.Migrate();
- }
-
- host.Run();
+ await host.RunAsync();
}
public static IHostBuilder CreateWebHostBuilder(string[] args) =>
|