Method AddDiscordHostedShardService
- Namespace
- DisCatSharp.Hosting.DependencyInjection
- Assembly
- DisCatSharp.Hosting.DependencyInjection.dll
AddDiscordHostedShardService<TService>(IHostApplicationBuilder)
Adds your bot as a sharded background service to the host application builder.
public static IHostApplicationBuilder AddDiscordHostedShardService<TService>(this IHostApplicationBuilder builder) where TService : class, IDiscordHostedShardService
Parameters
builderIHostApplicationBuilderThe host application builder to update.
Returns
- IHostApplicationBuilder
The
builderfor chaining purposes.
Type Parameters
TServiceThe hosted Discord shard service implementation.
AddDiscordHostedShardService<TInterface, TService>(IHostApplicationBuilder)
Adds a sharded Discord background service that can also be resolved via TInterface to the host application builder.
public static IHostApplicationBuilder AddDiscordHostedShardService<TInterface, TService>(this IHostApplicationBuilder builder) where TInterface : class, IDiscordHostedShardService where TService : class, TInterface, IDiscordHostedShardService
Parameters
builderIHostApplicationBuilderThe host application builder to update.
Returns
- IHostApplicationBuilder
The
builderfor chaining purposes.
Type Parameters
TInterfaceThe service contract exposed from dependency injection.
TServiceThe hosted Discord shard service implementation.
AddDiscordHostedShardService<TService>(IHostBuilder)
Adds your bot as a sharded background service to the host builder.
public static IHostBuilder AddDiscordHostedShardService<TService>(this IHostBuilder builder) where TService : class, IDiscordHostedShardService
Parameters
builderIHostBuilderThe host builder to update.
Returns
- IHostBuilder
The
builderfor chaining purposes.
Type Parameters
TServiceThe hosted Discord shard service implementation.
AddDiscordHostedShardService<TInterface, TService>(IHostBuilder)
Adds a sharded Discord background service that can also be resolved via TInterface to the host builder.
public static IHostBuilder AddDiscordHostedShardService<TInterface, TService>(this IHostBuilder builder) where TInterface : class, IDiscordHostedShardService where TService : class, TInterface, IDiscordHostedShardService
Parameters
builderIHostBuilderThe host builder to update.
Returns
- IHostBuilder
The
builderfor chaining purposes.
Type Parameters
TInterfaceThe service contract exposed from dependency injection.
TServiceThe hosted Discord shard service implementation.