From da37ece5e4f0f28ec3ea26de4eec236528374cbc Mon Sep 17 00:00:00 2001 From: Luiz Carlos Faria Date: Mon, 3 Jun 2024 18:58:31 -0300 Subject: [PATCH] Update README.md --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d9a5dd7..c349bdc 100644 --- a/README.md +++ b/README.md @@ -72,15 +72,14 @@ builder.Services.MapQueue(config => con #### Scoped and Keyed Services ```cs -builder.Services.AddKeyedScoped("key-of-service"); -// or -builder.Services.AddKeyedScoped("key-of-service", (sp, key) => new BusinessService(... custom dependencies ...)); +builder.Services.AddKeyedScoped("key-of-service-1"); +builder.Services.AddKeyedScoped("key-of-service-2", (sp, key) => new BusinessService(... custom dependencies ...)); builder.Services.AddSingleton(); builder.Services.MapQueue(config => config .WithDispatchInChildScope() - .WithKeyedService("key-of-service") + .WithKeyedService("key-of-service-1") // or "key-of-service-2" .WithAdapter((svc, msg) => svc.DoSomethingAsync(msg)) .WithQueueName("events") .WithPrefetchCount(1)