File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 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()
163163
164164 private async Task RunOnDatabaseAsync ( Func < AppDbContext , Task > asyncAction )
165165 {
166- using IServiceScope scope = _factory . Services . CreateScope ( ) ;
166+ await using AsyncServiceScope scope = _factory . Services . CreateAsyncScope ( ) ;
167167 var dbContext = scope . ServiceProvider . GetRequiredService < AppDbContext > ( ) ;
168168
169169 await asyncAction ( dbContext ) ;
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ public void ConfigureServicesAfterStartup(Action<IServiceCollection> servicesCon
130130
131131 public async Task RunOnDatabaseAsync ( Func < TDbContext , Task > asyncAction )
132132 {
133- using IServiceScope scope = Factory . Services . CreateScope ( ) ;
133+ await using AsyncServiceScope scope = Factory . Services . CreateAsyncScope ( ) ;
134134 var dbContext = scope . ServiceProvider . GetRequiredService < TDbContext > ( ) ;
135135
136136 await asyncAction ( dbContext ) ;
You can’t perform that action at this time.
0 commit comments