Пример #1
0
        /// <summary>
        /// Register a consumer convention to be used for finding message types
        /// </summary>
        /// <typeparam name="T">The convention type</typeparam>
        public static bool Register <T>()
            where T : IConsumerConvention, new()
        {
            var convention = new T();

            return(ConsumerConventionCache.TryAdd(convention));
        }
Пример #2
0
        /// <summary>
        /// Register a consumer convention to be used for finding message types
        /// </summary>
        /// <typeparam name="T">The convention type</typeparam>
        public static bool Register <T>(T convention)
            where T : IConsumerConvention
        {
            if (convention == null)
            {
                throw new ArgumentNullException(nameof(convention));
            }

            return(ConsumerConventionCache.TryAdd(convention));
        }