Beispiel #1
0
            void IExchangeInfoProvider.Save(Exchange exchange)
            {
                if (exchange == null)
                {
                    throw new ArgumentNullException(nameof(exchange));
                }

                lock (_exchanges.SyncRoot)
                {
                    if (!_exchanges.TryAdd(exchange.Name, exchange))
                    {
                        return;
                    }
                }

                ExchangeAdded.SafeInvoke(exchange);
            }
Beispiel #2
0
        /// <summary>
        /// To save the exchange.
        /// </summary>
        /// <param name="exchange">Exchange.</param>
        public void Save(Exchange exchange)
        {
            if (exchange == null)
            {
                throw new ArgumentNullException(nameof(exchange));
            }

            _entityRegistry.Exchanges.Save(exchange);

            lock (_exchanges.SyncRoot)
            {
                if (!_exchanges.TryAdd(exchange.Name, exchange))
                {
                    return;
                }
            }

            ExchangeAdded.SafeInvoke(exchange);
        }