public IReadOnlyList <ExchangeExtPriceSettingsModel> ListByAssetPair([NotNull] string assetPairId) { if (assetPairId == null) { throw new ArgumentNullException(nameof(assetPairId)); } return(_extPricesSettingsService.Get(assetPairId)?.Exchanges .Select(e => Convert(assetPairId, e.Key, e.Value)) .OrderBy(a => a.ExchangeName).ToList() ?? new List <ExchangeExtPriceSettingsModel>()); }
public ImmutableDictionary <string, ExternalOrderbook> AddAndGetByAssetPair(ExternalOrderbook orderbook) { var existingExchanges = _extPricesSettingsService.Get(orderbook.AssetPairId).Exchanges.Keys; return(_orderbooks.AddOrUpdate(orderbook.AssetPairId, k => ImmutableDictionary.Create <string, ExternalOrderbook>().Add(orderbook.ExchangeName, orderbook), (k, dict) => AddOrderbookAndFilterByExchangeExistance(orderbook, dict, existingExchanges))); }
public IReadOnlyList <AssetPairExtPriceSettingsModel> List() { return(_extPricesSettingsService.Get().Select(p => Convert(p.Key, p.Value)).OrderBy(m => m.AssetPairId) .ToList()); }