Class WebhookHandlerServiceCollectionExtensions
- Namespace
- NetCord.Hosting.AspNetCore
- Assembly
- NetCord.Hosting.AspNetCore.dll
public static class WebhookHandlerServiceCollectionExtensions
- Inheritance
-
WebhookHandlerServiceCollectionExtensions
- Inherited Members
Methods
AddWebhookHandler(IServiceCollection, WebhookEvent, Delegate, ServiceLifetime)
Adds an IWebhookHandler to the specified IServiceCollection.
public static IServiceCollection AddWebhookHandler(this IServiceCollection services, WebhookEvent webhookEvent, Delegate handler, ServiceLifetime lifetime = ServiceLifetime.Singleton)
Parameters
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
webhookEventWebhookEventThe webhook event.
handlerDelegateThe delegate that represents the handler.
lifetimeServiceLifetimeThe ServiceLifetime of the IWebhookHandler.
Returns
- IServiceCollection
A reference to this instance after the operation has completed.
AddWebhookHandler(IServiceCollection, Type, ServiceLifetime)
Adds an IWebhookHandler to the specified IServiceCollection.
public static IServiceCollection AddWebhookHandler(this IServiceCollection services, Type handlerType, ServiceLifetime lifetime = ServiceLifetime.Singleton)
Parameters
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
handlerTypeTypeThe type of the IWebhookHandler to add.
lifetimeServiceLifetimeThe ServiceLifetime of the IWebhookHandler.
Returns
- IServiceCollection
A reference to this instance after the operation has completed.
AddWebhookHandler<T>(IServiceCollection, ServiceLifetime)
Adds an IWebhookHandler to the specified IServiceCollection.
public static IServiceCollection AddWebhookHandler<T>(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Singleton) where T : class, IWebhookHandler
Parameters
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
lifetimeServiceLifetimeThe ServiceLifetime of the IWebhookHandler.
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, ServiceLifetime)
Adds an IWebhookHandler to the specified IServiceCollection.
public static IServiceCollection AddWebhookHandler<T>(this IServiceCollection services, WebhookEvent<T> webhookEvent, Delegate handler, ServiceLifetime lifetime = ServiceLifetime.Singleton)
Parameters
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
webhookEventWebhookEvent<T>The webhook event.
handlerDelegateThe delegate that represents the handler.
lifetimeServiceLifetimeThe ServiceLifetime of the IWebhookHandler.
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>, ServiceLifetime)
Adds an IWebhookHandler to the specified IServiceCollection.
public static IServiceCollection AddWebhookHandler<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory, ServiceLifetime lifetime = ServiceLifetime.Singleton) where T : class, IWebhookHandler
Parameters
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler to.
implementationFactoryFunc<IServiceProvider, T>The factory that creates the IWebhookHandler.
lifetimeServiceLifetimeThe ServiceLifetime of 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, ServiceLifetime)
Adds all public IWebhookHandler implementations from the specified assembly to the IServiceCollection.
public static IServiceCollection AddWebhookHandlers(this IServiceCollection services, Assembly assembly, ServiceLifetime lifetime = ServiceLifetime.Singleton)
Parameters
servicesIServiceCollectionThe IServiceCollection to add the IWebhookHandler implementations to.
assemblyAssemblyThe assembly to scan for IWebhookHandler implementations.
lifetimeServiceLifetimeThe ServiceLifetime of the IWebhookHandler implementations.
Returns
- IServiceCollection
A reference to this instance after the operation has completed.