API reference
Method AddDisCatSharpAspNetCoreSelfHost
- Namespace
- DisCatSharp.Hosting.AspNetCore
- Assembly
- DisCatSharp.Hosting.AspNetCore.dll
AddDisCatSharpAspNetCoreSelfHost(IServiceCollection, Action<DiscordAspNetCoreSelfHostOptions>?, Action<DiscordWebIngressOptions>?, Action<DiscordAspNetCoreIngressOptions>?)
Registers the optional self-hosted ASP.NET Core ingress infrastructure for applications that do not already own an ASP.NET Core app.
public static IServiceCollection AddDisCatSharpAspNetCoreSelfHost(this IServiceCollection services, Action<DiscordAspNetCoreSelfHostOptions>? configureSelfHost = null, Action<DiscordWebIngressOptions>? configure = null, Action<DiscordAspNetCoreIngressOptions>? configureAspNetCore = null)
Parameters
servicesIServiceCollectionThe service collection to update.
configureSelfHostAction<DiscordAspNetCoreSelfHostOptions>Optional configuration callback for the internal ASP.NET Core host.
configureAction<DiscordWebIngressOptions>Optional configuration callback for the ingress subsystem.
configureAspNetCoreAction<DiscordAspNetCoreIngressOptions>Optional configuration callback for ASP.NET Core endpoint conventions.
Returns
- IServiceCollection
The service collection for chaining purposes.
Remarks
This mode spins up a private WebApplication behind the hosting abstraction and bridges the ingress services from the primary dependency injection container into that internal app. Use it when you need the HTTP ingress surface but do not otherwise host ASP.NET Core yourself.
Exceptions
- ArgumentNullException
servicesis null.