Example #1
0
        /// <summary>
        /// Adds the distributed extension to the provided event broker.
        /// </summary>
        /// <typeparam name="TDistributedExtension">The type of the distributed extension.</typeparam>
        /// <param name="eventBroker">The event broker.</param>
        /// <param name="extension">The extension.</param>
        /// <param name="eventBrokerIdentification">The event broker identification.</param>
        public static void AddDistributedExtension <TDistributedExtension>(this IEventBroker eventBroker, TDistributedExtension extension, string eventBrokerIdentification)
            where TDistributedExtension : IDistributedEventBrokerExtension
        {
            Ensure.ArgumentNotNull(eventBroker, "eventBroker");

            eventBroker.AddExtension(extension);
            extension.Manage(eventBroker, eventBrokerIdentification);
        }
        /// <summary>
        /// Adds the mapping extension to the provided event broker.
        /// </summary>
        /// <typeparam name="TMappingExtension">The type of the mapping extension.</typeparam>
        /// <param name="eventBroker">The event broker.</param>
        /// <param name="extension">The extension.</param>
        public static void AddMappingExtension <TMappingExtension>(this IEventBroker eventBroker, TMappingExtension extension)
            where TMappingExtension : IMappingEventBrokerExtension
        {
            Ensure.ArgumentNotNull(eventBroker, "eventBroker");

            eventBroker.AddExtension(extension);
            extension.Manage(eventBroker);
        }