Class KookWebhookClientExtension
提供用于与 ASP.NET 集成,注册与配置 KookAspNetWebhookClient 的扩展方法。
public static class KookWebhookClientExtension
- Inheritance
-
KookWebhookClientExtension
- Inherited Members
Methods
AddKeyedKookAspNetWebhookClient(IServiceCollection, string?)
向指定的 IServiceCollection 添加 KOOK Webhook 客户端。
public static IServiceCollection AddKeyedKookAspNetWebhookClient(this IServiceCollection services, string? serviceKey)
Parameters
servicesIServiceCollection要向其添加 KOOK ASP.NET Webhook 客户端的服务集合。
serviceKeystring服务的键。
Returns
- IServiceCollection
添加了 KOOK ASP.NET Webhook 客户端的服务集合。
AddKeyedKookAspNetWebhookClient(IServiceCollection, string?, KookAspNetWebhookConfig)
向指定的 IServiceCollection 添加 KookAspNetWebhookClient 客户端。
public static IServiceCollection AddKeyedKookAspNetWebhookClient(this IServiceCollection services, string? serviceKey, KookAspNetWebhookConfig config)
Parameters
servicesIServiceCollection要向其添加 KOOK ASP.NET Webhook 客户端的服务集合。
serviceKeystring服务的键。
configKookAspNetWebhookConfig用于配置 KOOK ASP.NET Webhook 客户端的配置。
Returns
- IServiceCollection
添加了 KOOK ASP.NET Webhook 客户端的服务集合。
AddKookAspNetWebhookClient(IServiceCollection)
向指定的 IServiceCollection 添加 KOOK Webhook 客户端。
public static IServiceCollection AddKookAspNetWebhookClient(this IServiceCollection services)
Parameters
servicesIServiceCollection要向其添加 KOOK ASP.NET Webhook 客户端的服务集合。
Returns
- IServiceCollection
添加了 KOOK ASP.NET Webhook 客户端的服务集合。
AddKookAspNetWebhookClient(IServiceCollection, KookAspNetWebhookConfig)
向指定的 IServiceCollection 添加 KookAspNetWebhookClient 客户端。
public static IServiceCollection AddKookAspNetWebhookClient(this IServiceCollection services, KookAspNetWebhookConfig config)
Parameters
servicesIServiceCollection要向其添加 KOOK ASP.NET Webhook 客户端的服务集合。
configKookAspNetWebhookConfig用于配置 KOOK ASP.NET Webhook 客户端的配置。
Returns
- IServiceCollection
添加了 KOOK ASP.NET Webhook 客户端的服务集合。
AddKookAspNetWebhookClient(IServiceCollection, Action<KookAspNetWebhookConfig>)
向指定的 IServiceCollection 添加 KookAspNetWebhookClient 客户端。
public static IServiceCollection AddKookAspNetWebhookClient(this IServiceCollection services, Action<KookAspNetWebhookConfig> configure)
Parameters
servicesIServiceCollection要向其添加 KOOK ASP.NET Webhook 客户端的服务集合。
configureAction<KookAspNetWebhookConfig>用于配置 KOOK ASP.NET Webhook 客户端的配置委托。
Returns
- IServiceCollection
添加了 KOOK ASP.NET Webhook 客户端的服务集合。
UseAspNetWebhookClient(IKookClientServiceConfigurator, Action<KookAspNetWebhookConfig>)
配置 KOOK 服务以使用 ASP.NET Webhook 客户端。
public static IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig> UseAspNetWebhookClient(this IKookClientServiceConfigurator configurator, Action<KookAspNetWebhookConfig> configure)
Parameters
configuratorIKookClientServiceConfiguratorKOOK 服务配置器。
configureAction<KookAspNetWebhookConfig>用于配置 KOOK ASP.NET Webhook 客户端的配置委托。
Returns
- IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig>
配置了 KOOK ASP.NET Webhook 客户端的配置器。
UseHostedClient(IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig>, TokenType, string, bool)
配置 KOOK 服务以将 ASP.NET Webhook 客户端包装为 IHostedService。
[Obsolete("The KookAspNetWebhookClient itself is a hosted service, configure the token in the KookAspNetWebhookConfig.")]
public static IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig> UseHostedClient(this IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig> configurator, TokenType tokenType, string token, bool validateToken = true)
Parameters
configuratorIKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig>KOOK 服务配置器。
tokenTypeTokenType令牌的类型。
tokenstring令牌。
validateTokenbool是否验证令牌。
Returns
- IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig>
配置了 ASP.NET Webhook 客户端的配置器。
UseHostedClient(IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig>, Func<IServiceProvider, TokenType>, Func<IServiceProvider, string>, Func<IServiceProvider, bool>?)
配置 KOOK 服务以将 ASP.NET Webhook 客户端包装为 IHostedService。
[Obsolete("The KookAspNetWebhookClient itself is a hosted service, configure the token in the KookAspNetWebhookConfig.")]
public static IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig> UseHostedClient(this IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig> configurator, Func<IServiceProvider, TokenType> tokenType, Func<IServiceProvider, string> token, Func<IServiceProvider, bool>? validateToken = null)
Parameters
configuratorIKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig>KOOK 服务配置器。
tokenTypeFunc<IServiceProvider, TokenType>令牌的类型。
tokenFunc<IServiceProvider, string>令牌。
validateTokenFunc<IServiceProvider, bool>是否验证令牌。
Returns
- IKookClientConfigurator<KookAspNetWebhookClient, KookAspNetWebhookConfig>
配置了 ASP.NET Webhook 客户端的配置器。
UseKeyedKookEndpoint<T>(T, string?, string?)
向 IApplicationBuilder 添加 KOOK Webhook 路由端点。
public static T UseKeyedKookEndpoint<T>(this T builder, string? serviceKey, string? routePattern = null) where T : IHost, IEndpointRouteBuilder
Parameters
builderT要向其添加 KOOK Webhook 端点的应用程序构建器。
serviceKeystring服务的键。
routePatternstring用于注册 KOOK Webhook 的路由模式。
Returns
- T
添加了 KOOK Webhook 端点的应用程序构建器。
Type Parameters
T
UseKookEndpoint<T>(T, string?)
向 IApplicationBuilder 添加 KOOK Webhook 路由端点。
public static T UseKookEndpoint<T>(this T builder, string? routePattern = null) where T : IHost, IEndpointRouteBuilder
Parameters
builderT要向其添加 KOOK Webhook 端点的应用程序构建器。
routePatternstring用于注册 KOOK Webhook 的路由模式。
Returns
- T
添加了 KOOK Webhook 端点的应用程序构建器。
Type Parameters
T