Browse Source

Use the new CreateAsyncScope() API introduced in .NET 6.0

pull/1369/head
Kévin Chalet 4 years ago
parent
commit
62de1d3e90
  1. 2
      samples/Mvc.Server/Worker.cs

2
samples/Mvc.Server/Worker.cs

@ -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);

Loading…
Cancel
Save