public async Task Run() { _Logger.LogInformation("Running..."); _Logger.LogInformation("Apply WorkflowDb Migrations..."); await _WorkflowDbContext.Database.MigrateAsync(); _Logger.LogInformation("Apply ExposureContentDb Migrations..."); await _ExposureContentDbContext.Database.MigrateAsync(); _Logger.LogInformation("Seeding ExposureContent..."); var db = new CreateContentDatabase(_ExposureContentDbContext, new StandardUtcDateTimeProvider(), new CmsSigner(new ResourceCertificateProvider("FakeRSA.p12"))); await db.AddExampleContent(); _Logger.LogInformation("Apply ICCBackedContentDbContext Migrations..."); await _IccBackendContentDbContext.Database.MigrateAsync(); _Logger.LogInformation("Completed..."); }
public async Task Run(string[] args) { _Logger.LogInformation("Running..."); switch (args[0]) { case "seed": { _Logger.LogInformation("Seeding ExposureContent..."); var certificateProvider = new HsmCertificateProvider(new CertificateProviderConfig(_Configuration, "ExposureKeySets:Signing:NL")); var db = new CreateContentDatabase(_ExposureContentDbContext, new StandardUtcDateTimeProvider(), new CmsSigner(certificateProvider), _JsonSerializer); await db.DropExampleContent(); await db.AddExampleContent(); break; } default: { _Logger.LogInformation("Apply WorkflowDb Migrations..."); await _WorkflowDbContext.Database.MigrateAsync(); _Logger.LogInformation("Apply ExposureContentDb Migrations..."); await _ExposureContentDbContext.Database.MigrateAsync(); _Logger.LogInformation("Apply ICCBackedContentDbContext Migrations..."); await _IccBackendContentDbContext.Database.MigrateAsync(); break; } } _Logger.LogInformation("Completed..."); }