Skip to content

Commit 94fe2a1

Browse files
committed
Fix highlighting
1 parent 02ff9f1 commit 94fe2a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/core/extensions/scoped-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The preceding interface defines a single `DoWorkAsync` method. Create an impleme
4848

4949
Replace the existing `Worker` class with the following C# code, and rename the file to *ScopedBackgroundService.cs*:
5050

51-
:::code source="snippets/workers/scoped-service/ScopedBackgroundService.cs" highlight="22-28":::
51+
:::code source="snippets/workers/scoped-service/ScopedBackgroundService.cs" highlight="14-24":::
5252

5353
In the preceding code, while the `stoppingToken` isn't canceled, the `IServiceScopeFactory` is used to create a scope. From the `IServiceScope`, the `IScopedProcessingService` is resolved. The `DoWorkAsync` method is awaited, and the `stoppingToken` is passed to the method. Finally, the execution is delayed for 10 seconds and the loop continues. Each time the `DoWorkAsync` method is called, a new instance of the `DefaultScopedProcessingService` is created and the instance identifier is logged.
5454

0 commit comments

Comments
 (0)