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
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
Returns
- IServiceCollection
A reference to this instance after the operation has completed.
Type Parameters
TThe 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
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
webhookEventWebhookEvent<T>The webhook event.
handlerDelegateThe delegate that represents the handler.
Returns
- IServiceCollection
A reference to this instance after the operation has completed.
Type Parameters
TThe 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
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
implementationFactoryFunc<IServiceProvider, T>The factory that creates the IWebhookHandler.
Returns
- IServiceCollection
A reference to this instance after the operation has completed.
Type Parameters
TThe 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
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler implementations to.
assemblyAssemblyThe assembly to scan for IWebhookHandler implementations.
Returns
- IServiceCollection
A reference to this instance after the operation has completed.