/// <summary>
        /// Adds JustSaying services to the registry.
        /// </summary>
        /// <param name="registry">The <see cref="ConfigurationExpression"/> to add JustSaying services to.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="registry"/> is <see langword="null"/>.
        /// </exception>
        public static void AddJustSaying(this ConfigurationExpression registry)
        {
            if (registry == null)
            {
                throw new ArgumentNullException(nameof(registry));
            }

            registry.AddJustSaying((_) => { });
        }
        /// <summary>
        /// Adds JustSaying services to the registry.
        /// </summary>
        /// <param name="registry">The <see cref="ConfigurationExpression"/> to add JustSaying services to.</param>
        /// <param name="configure">A delegate to a method to use to configure JustSaying.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="registry"/> or <paramref name="configure"/> is <see langword="null"/>.
        /// </exception>
        public static void AddJustSaying(this ConfigurationExpression registry, Action <MessagingBusBuilder> configure)
        {
            if (registry == null)
            {
                throw new ArgumentNullException(nameof(registry));
            }

            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            registry.AddJustSaying((builder, _) => configure(builder));
        }
        /// <summary>
        /// Adds JustSaying services to the registry.
        /// </summary>
        /// <param name="registry">The <see cref="ConfigurationExpression"/> to add JustSaying services to.</param>
        /// <param name="region">The AWS region to configure.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="registry"/> or <paramref name="region"/> is <see langword="null"/>.
        /// </exception>
        public static void AddJustSaying(this ConfigurationExpression registry, string region)
        {
            if (registry == null)
            {
                throw new ArgumentNullException(nameof(registry));
            }

            if (string.IsNullOrWhiteSpace(region))
            {
                throw new ArgumentException("region must not be null or empty", nameof(region));
            }

            registry.AddJustSaying(
                (builder) => builder.Messaging(
                    (options) => options.WithRegion(region)));
        }
示例#4
0
        /// <summary>
        /// Adds JustSaying services to the registry.
        /// </summary>
        /// <param name="registry">The <see cref="ConfigurationExpression"/> to add JustSaying services to.</param>
        /// <param name="regions">The AWS region(s) to configure.</param>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="registry"/> or <paramref name="regions"/> is <see langword="null"/>.
        /// </exception>
        public static void AddJustSaying(this ConfigurationExpression registry, params string[] regions)
        {
            if (registry == null)
            {
                throw new ArgumentNullException(nameof(registry));
            }

            if (regions == null)
            {
                throw new ArgumentNullException(nameof(regions));
            }

            registry.AddJustSaying(
                (builder) => builder.Messaging(
                    (options) => options.WithRegions(regions)));
        }