16 using System.Collections.Generic;
17 using System.Collections.Concurrent;
34 private readonly ConcurrentDictionary<int, Order> _pendingGroupOrders =
new();
47 if (!order.TryGetGroupOrders(TryGetOrder, out orders))
53 RemoveCachedOrders(orders);
64 private Order TryGetOrder(
int orderId)
66 _pendingGroupOrders.TryGetValue(orderId, out var order);
74 private void CacheOrder(Order order)
76 _pendingGroupOrders[order.Id] = order;
83 private void RemoveCachedOrders(List<Order> orders)
85 for (var i = 0; i < orders.Count; i++)
87 _pendingGroupOrders.TryRemove(orders[i].Id, out _);