Browse Source
Merge pull request #11920 from gpcaretti/patch-1
Documentation fix for AddBackgroundWorkerAsync
pull/11985/head
Enis Necipoglu
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
5 additions and
5 deletions
-
docs/en/Background-Workers.md
|
|
|
@ -86,20 +86,20 @@ After creating a background worker class, you should add it to the `IBackgroundW |
|
|
|
[DependsOn(typeof(AbpBackgroundWorkersModule))] |
|
|
|
public class MyModule : AbpModule |
|
|
|
{ |
|
|
|
public override void OnApplicationInitialization( |
|
|
|
public override Task OnApplicationInitializationAsync( |
|
|
|
ApplicationInitializationContext context) |
|
|
|
{ |
|
|
|
context.AddBackgroundWorker<PassiveUserCheckerWorker>(); |
|
|
|
context.AddBackgroundWorkerAsync<PassiveUserCheckerWorker>(); |
|
|
|
} |
|
|
|
} |
|
|
|
```` |
|
|
|
|
|
|
|
`context.AddBackgroundWorker(...)` is a shortcut extension method for the expression below: |
|
|
|
`context.AddBackgroundWorkerAsync(...)` is a shortcut extension method for the expression below: |
|
|
|
|
|
|
|
````csharp |
|
|
|
context.ServiceProvider |
|
|
|
await context.ServiceProvider |
|
|
|
.GetRequiredService<IBackgroundWorkerManager>() |
|
|
|
.Add( |
|
|
|
.AddAsync( |
|
|
|
context |
|
|
|
.ServiceProvider |
|
|
|
.GetRequiredService<PassiveUserCheckerWorker>() |
|
|
|
|