Table of Contents

Class WebhookHandlerServiceCollectionExtensions

Namespace
NetCord.Hosting.AspNetCore
Assembly
NetCord.Hosting.AspNetCore.dll
public static class WebhookHandlerServiceCollectionExtensions
Inheritance
WebhookHandlerServiceCollectionExtensions
Inherited Members

Methods

AddWebhookHandler<T>(IServiceCollection)

Adds an IWebhookHandler to the specified IServiceCollection.

public static IServiceCollection AddWebhookHandler<T>(this IServiceCollection services) where T : class, IWebhookHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IWebhookHandler to.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IWebhookHandler to add.

AddWebhookHandler<T>(IServiceCollection, WebhookEvent<T>, Delegate)

Adds an IWebhookHandler to the specified IServiceCollection.

public static IServiceCollection AddWebhookHandler<T>(this IServiceCollection services, WebhookEvent<T> webhookEvent, Delegate handler)

Parameters

services IServiceCollection

The IServiceCollection to add the IWebhookHandler to.

webhookEvent WebhookEvent<T>

The webhook event.

handler Delegate

The delegate that represents the handler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the event handler argument.

AddWebhookHandler<T>(IServiceCollection, Func<IServiceProvider, T>)

Adds an IWebhookHandler to the specified IServiceCollection.

public static IServiceCollection AddWebhookHandler<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory) where T : class, IWebhookHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IWebhookHandler to.

implementationFactory Func<IServiceProvider, T>

The factory that creates the IWebhookHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IWebhookHandler to add.

AddWebhookHandlers(IServiceCollection, Assembly)

Adds all public IWebhookHandler implementations from the specified assembly to the IServiceCollection.

public static IServiceCollection AddWebhookHandlers(this IServiceCollection services, Assembly assembly)

Parameters

services IServiceCollection

The IServiceCollection to add the IWebhookHandler implementations to.

assembly Assembly

The assembly to scan for IWebhookHandler implementations.

Returns

IServiceCollection

A reference to this instance after the operation has completed.