I sorted a dictionary like this:
var sortedListOfNodes = _nodeDictionary.Values.OrderBy((n) => n.Time);
Then I selected an element as such:
var selectedNode = sortedListOfNodes.First(n => n.Time - CurrentTime > new TimeSpan(1,0,0));
Then I did some processing on that node and at the end wanted to remove the node from the list, without destroying the sorted order.
Would the below maintain the order?
sortedListOfNodes = (IOrderedEnumerable<Node>)sortedListOfNodes.Where(node => node != selectedNode);