From edf68354bc87abde35da2acd9745f49c5b0e3adf Mon Sep 17 00:00:00 2001 From: Gianpiero Caretti Date: Sat, 12 Mar 2022 01:04:54 +0100 Subject: [PATCH] Documentation fix for AddBackgroundWorkerAsync Fixed the code sample by correctly call AddBackgroundWorkerAsync instead of AddBackgroundWorker --- docs/en/Background-Workers.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/en/Background-Workers.md b/docs/en/Background-Workers.md index 0c9e26e409..726a8817ab 100644 --- a/docs/en/Background-Workers.md +++ b/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(); + context.AddBackgroundWorkerAsync(); } } ```` -`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() - .Add( + .AddAsync( context .ServiceProvider .GetRequiredService()