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

            ConsumerConventionCache.Add(TypeMetadataCache <T> .ShortName, 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 void Register <T>()
            where T : IConsumerConvention, new()
        {
            var convention = new T();

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

            ConsumerConventionCache.Add(TypeMetadataCache <T> .ShortName, convention);
        }