|
|
|
@ -14,7 +14,7 @@ public class Worker : IHostedService |
|
|
|
|
|
|
|
public async Task StartAsync(CancellationToken cancellationToken) |
|
|
|
{ |
|
|
|
using var scope = _serviceProvider.CreateScope(); |
|
|
|
await using var scope = _serviceProvider.CreateAsyncScope(); |
|
|
|
|
|
|
|
var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>(); |
|
|
|
await context.Database.EnsureCreatedAsync(cancellationToken); |
|
|
|
|