Skip to content

Commit

Permalink
Fix DbMigratorHostedService
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlcf88 committed Dec 27, 2023
1 parent d9103f3 commit 6dda9a4
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Microsoft.Extensions.Hosting;
using Serilog;
using Volo.Abp;
using Volo.Abp.Data;

namespace EShopSample.DbMigrator;

Expand All @@ -23,11 +24,12 @@ public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime,
public async Task StartAsync(CancellationToken cancellationToken)
{
using (var application = await AbpApplicationFactory.CreateAsync<EShopSampleDbMigratorModule>(options =>
{
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
}))
{
options.Services.ReplaceConfiguration(_configuration);
options.UseAutofac();
options.Services.AddLogging(c => c.AddSerilog());
options.AddDataMigrationEnvironment();
}))
{
await application.InitializeAsync();

Expand Down

0 comments on commit 6dda9a4

Please sign in to comment.