Table of Contents

Class GatewayHandlerServiceCollectionExtensions

Namespace
NetCord.Hosting.Gateway
Assembly
NetCord.Hosting.dll
public static class GatewayHandlerServiceCollectionExtensions
Inheritance
GatewayHandlerServiceCollectionExtensions
Inherited Members

Methods

AddGatewayHandler(IServiceCollection, GatewayEvent, Delegate, ServiceLifetime)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler(this IServiceCollection services, GatewayEvent gatewayEvent, Delegate handler, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

gatewayEvent GatewayEvent

The gateway event.

handler Delegate

The delegate that represents the handler.

lifetime ServiceLifetime

The ServiceLifetime of the IGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddGatewayHandler(IServiceCollection, Type, ServiceLifetime)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler(this IServiceCollection services, Type handlerType, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

handlerType Type

The type of the IGatewayHandler to add.

lifetime ServiceLifetime

The ServiceLifetime of the IGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddGatewayHandler<T>(IServiceCollection, ServiceLifetime)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler<T>(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Singleton) where T : class, IGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

lifetime ServiceLifetime

The ServiceLifetime of the IGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IGatewayHandler to add.

AddGatewayHandler<T>(IServiceCollection, GatewayEvent<T>, Delegate, ServiceLifetime)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler<T>(this IServiceCollection services, GatewayEvent<T> gatewayEvent, Delegate handler, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

gatewayEvent GatewayEvent<T>

The gateway event.

handler Delegate

The delegate that represents the handler.

lifetime ServiceLifetime

The ServiceLifetime of the IGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the event handler argument.

AddGatewayHandler<T>(IServiceCollection, Func<IServiceProvider, T>, ServiceLifetime)

Adds an IGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddGatewayHandler<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory, ServiceLifetime lifetime = ServiceLifetime.Singleton) where T : class, IGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler to.

implementationFactory Func<IServiceProvider, T>

The factory that creates the IGatewayHandler.

lifetime ServiceLifetime

The ServiceLifetime of the IGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IGatewayHandler to add.

AddGatewayHandlers(IServiceCollection, Assembly, ServiceLifetime)

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

public static IServiceCollection AddGatewayHandlers(this IServiceCollection services, Assembly assembly, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IGatewayHandler implementations to.

assembly Assembly

The assembly to scan for IGatewayHandler implementations.

lifetime ServiceLifetime

The ServiceLifetime of the IGatewayHandler implementations.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddShardedGatewayHandler(IServiceCollection, GatewayEvent, Delegate, ServiceLifetime)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler(this IServiceCollection services, GatewayEvent gatewayEvent, Delegate handler, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

gatewayEvent GatewayEvent

The gateway event.

handler Delegate

The delegate that represents the handler.

lifetime ServiceLifetime

The ServiceLifetime of the IShardedGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddShardedGatewayHandler(IServiceCollection, Type, ServiceLifetime)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler(this IServiceCollection services, Type handlerType, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

handlerType Type

The type of the IShardedGatewayHandler to add.

lifetime ServiceLifetime

The ServiceLifetime of the IShardedGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

AddShardedGatewayHandler<T>(IServiceCollection, ServiceLifetime)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler<T>(this IServiceCollection services, ServiceLifetime lifetime = ServiceLifetime.Singleton) where T : class, IShardedGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

lifetime ServiceLifetime

The ServiceLifetime of the IShardedGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IShardedGatewayHandler to add.

AddShardedGatewayHandler<T>(IServiceCollection, GatewayEvent<T>, Delegate, ServiceLifetime)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler<T>(this IServiceCollection services, GatewayEvent<T> gatewayEvent, Delegate handler, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

gatewayEvent GatewayEvent<T>

The gateway event.

handler Delegate

The delegate that represents the handler.

lifetime ServiceLifetime

The ServiceLifetime of the IShardedGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the event handler argument.

AddShardedGatewayHandler<T>(IServiceCollection, Func<IServiceProvider, T>, ServiceLifetime)

Adds an IShardedGatewayHandler to the specified IServiceCollection.

public static IServiceCollection AddShardedGatewayHandler<T>(this IServiceCollection services, Func<IServiceProvider, T> implementationFactory, ServiceLifetime lifetime = ServiceLifetime.Singleton) where T : class, IShardedGatewayHandler

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler to.

implementationFactory Func<IServiceProvider, T>

The factory that creates the IShardedGatewayHandler.

lifetime ServiceLifetime

The ServiceLifetime of the IShardedGatewayHandler.

Returns

IServiceCollection

A reference to this instance after the operation has completed.

Type Parameters

T

The type of the IShardedGatewayHandler to add.

AddShardedGatewayHandlers(IServiceCollection, Assembly, ServiceLifetime)

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

public static IServiceCollection AddShardedGatewayHandlers(this IServiceCollection services, Assembly assembly, ServiceLifetime lifetime = ServiceLifetime.Singleton)

Parameters

services IServiceCollection

The IServiceCollection to add the IShardedGatewayHandler implementations to.

assembly Assembly

The assembly to scan for IShardedGatewayHandler implementations.

lifetime ServiceLifetime

The ServiceLifetime of the IShardedGatewayHandler implementations.

Returns

IServiceCollection

A reference to this instance after the operation has completed.