Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/WhatsApp/WhatsAppHandlerExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
namespace Devlooped.WhatsApp;

class WhatsAppHandlerExtensions
/// <summary>
/// Provides the <see cref="AsBuilder"/> extension method to build a pipeline
/// around a given handler.
/// </summary>
public static class WhatsAppHandlerExtensions
{
/// <summary>
/// Creates a new <see cref="WhatsAppHandlerBuilder"/> using <paramref name="handler"/> as its inner handler.
/// </summary>
/// <remarks>
/// This method is equivalent to using the <see cref="WhatsAppHandlerBuilder"/> constructor directly.
/// </remarks>
/// <exception cref="ArgumentNullException"><paramref name="handler"/> is <see langword="null"/>.</exception>
public static WhatsAppHandlerBuilder AsBuilder(this IWhatsAppHandler handler)
{
Throw.IfNull(handler);
return new(_ => handler);
}
}
Loading