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); }
/// <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); }