コード例 #1
0
        /// <summary>
        /// Add WebHook configuration and services to the specified <paramref name="builder"/>.
        /// </summary>
        /// <param name="builder">The <see cref="IMvcBuilder" /> to configure.</param>
        /// <param name="connectionString">The connection string that is used.</param>
        /// <param name="configureOptions">The connection string that is used.</param>
        /// <returns>The <paramref name="builder"/>.</returns>
        public static IMvcBuilder AddWebHooks(this IMvcBuilder builder, Action <WebHookSettings> configureOptions)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            WebHookServiceCollectionSetup.AddWebHookServices(builder.Services, configureOptions);
            return(builder);
        }
コード例 #2
0
        /// <summary>
        /// <para>
        /// Add WebHook configuration and services to the specified <paramref name="builder"/>.
        /// </para>
        /// <para>
        /// '<c>WebHooks:{receiver name}:SecretKey:default</c>' configuration values usually contain secret keys for
        /// WebHook URIs of the form '<c>https://{host}/api/webhooks/incoming/{receiver name}</c>' (with a
        /// <c>?code=...</c> query string for some receivers). '<c>WebHooks:{receiver name}:SecretKey:{id}</c>'
        /// configuration values usually contain secret keys for WebHook URIs of the form
        /// '<c>https://{host}/api/webhooks/incoming/{receiver name}/{id}</c>'.
        /// </para>
        /// </summary>
        /// <param name="builder">The <see cref="IMvcCoreBuilder" /> to configure.</param>
        /// <returns>The <paramref name="builder"/>.</returns>
        public static IMvcCoreBuilder AddWebHooks(this IMvcCoreBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            WebHookServiceCollectionSetup.AddWebHookServices(builder.Services);

            return(builder);
        }
コード例 #3
0
        /// <summary>
        /// <para>
        /// Add WebHook configuration and services to the specified <paramref name="builder"/>.
        /// </para>
        /// <para>
        /// '<c>WebHooks:{receiver name}:SecretKey:default</c>' configuration values usually contain secret keys for
        /// WebHook URIs of the form '<c>https://{host}/api/webhooks/incoming/{receiver name}</c>' (with a
        /// <c>?code=...</c> query string for some receivers). '<c>WebHooks:{receiver name}:SecretKey:{id}</c>'
        /// configuration values usually contain secret keys for WebHook URIs of the form
        /// '<c>https://{host}/api/webhooks/incoming/{receiver name}/{id}</c>'.
        /// </para>
        /// </summary>
        /// <param name="builder">The <see cref="IMvcBuilder" /> to configure.</param>
        /// <returns>The <paramref name="builder"/>.</returns>
        public static IMvcBuilder AddWebHooks(this IMvcBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            WebHookServiceCollectionSetup.AddWebHookServices(builder.Services);
            builder.AddMvcOptions(options => options.EnableGlobalRouting = false);

            return(builder);
        }