File tree 2 files changed +2
-2
lines changed
2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ protected override HttpClient CreateClient()
163
163
164
164
private async Task RunOnDatabaseAsync ( Func < AppDbContext , Task > asyncAction )
165
165
{
166
- using IServiceScope scope = _factory . Services . CreateScope ( ) ;
166
+ await using AsyncServiceScope scope = _factory . Services . CreateAsyncScope ( ) ;
167
167
var dbContext = scope . ServiceProvider . GetRequiredService < AppDbContext > ( ) ;
168
168
169
169
await asyncAction ( dbContext ) ;
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ public void ConfigureServicesAfterStartup(Action<IServiceCollection> servicesCon
130
130
131
131
public async Task RunOnDatabaseAsync ( Func < TDbContext , Task > asyncAction )
132
132
{
133
- using IServiceScope scope = Factory . Services . CreateScope ( ) ;
133
+ await using AsyncServiceScope scope = Factory . Services . CreateAsyncScope ( ) ;
134
134
var dbContext = scope . ServiceProvider . GetRequiredService < TDbContext > ( ) ;
135
135
136
136
await asyncAction ( dbContext ) ;
You can’t perform that action at this time.
0 commit comments