Skip to content

Commit 26da821

Browse files
committed
Allow registering the WhatsApp handler separately
Add another overload that doesn't register any handler type.
1 parent 1299570 commit 26da821

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/WhatsApp/AzureFunctionsExtensions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ static void ConfigureServices(IServiceCollection services)
5757
.ValidateDataAnnotations();
5858
}
5959

60+
/// <summary>
61+
/// Configure WhatsApp functions and use an already registered service that implements <see cref="IWhatsAppHandler"/>.
62+
/// </summary>
63+
public static IFunctionsWorkerApplicationBuilder UseWhatsApp(this IFunctionsWorkerApplicationBuilder builder)
64+
{
65+
ConfigureServices(builder.Services);
66+
return builder;
67+
}
68+
6069
/// <summary>
6170
/// Configure the WhatsApp handler for Azure Functions.
6271
/// </summary>

0 commit comments

Comments
 (0)