Пример #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 bool Register <T>()
            where T : IConsumerConvention, new()
        {
            var convention = new T();

            return(ConsumerConventionCache.TryAdd(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>()
            where T : IConsumerConvention, new()
        {
            var convention = new T();

            ConsumerConventionCache.Add(convention);
        }
Пример #4
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);
        }
Пример #5
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));
        }
Пример #6
0
 /// <summary>
 /// Remove a consumer convention used for finding message types
 /// </summary>
 /// <typeparam name="T">The convention type to remove</typeparam>
 public static void Remove <T>()
     where T : IConsumerConvention
 {
     ConsumerConventionCache.Remove <T>();
 }
Пример #7
0
 /// <summary>
 /// Remove a consumer convention used for finding message types
 /// </summary>
 /// <typeparam name="T">The convention type to remove</typeparam>
 public static void Remove <T>()
     where T : IConsumerConvention
 {
     ConsumerConventionCache.Remove(TypeMetadataCache <T> .ShortName);
 }