示例#1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="Publisher" /> class.
 /// </summary>
 /// <param name="behaviorsProvider">
 ///     The <see cref="IBehaviorsProvider" />.
 /// </param>
 /// <param name="serviceProvider">
 ///     The <see cref="IServiceProvider" /> instance to be used to resolve the subscribers.
 /// </param>
 /// <param name="logger">
 ///     The <see cref="ISilverbackLogger" />.
 /// </param>
 public Publisher(
     IBehaviorsProvider behaviorsProvider,
     IServiceProvider serviceProvider,
     ISilverbackLogger <Publisher> logger)
 {
     _behaviorsProvider = Check.NotNull(behaviorsProvider, nameof(behaviorsProvider));
     _serviceProvider   = Check.NotNull(serviceProvider, nameof(serviceProvider));
     _logger            = Check.NotNull(logger, nameof(logger));
 }
示例#2
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="Publisher" /> class.
        /// </summary>
        /// <param name="behaviorsProvider">
        ///     The <see cref="IBehaviorsProvider" />.
        /// </param>
        /// <param name="serviceProvider">
        ///     The <see cref="IServiceProvider" /> instance to be used to resolve the subscribers.
        /// </param>
        /// <param name="logger">
        ///     The <see cref="ISilverbackLogger" />.
        /// </param>
        public Publisher(
            IBehaviorsProvider behaviorsProvider,
            IServiceProvider serviceProvider,
            ISilverbackLogger <Publisher> logger)
        {
            _behaviorsProvider = Check.NotNull(behaviorsProvider, nameof(behaviorsProvider));
            _serviceProvider   = Check.NotNull(serviceProvider, nameof(serviceProvider));
            _logger            = Check.NotNull(logger, nameof(logger));

            _subscribedMethodsCache = serviceProvider.GetRequiredService <SubscribedMethodsCache>();
        }