Silly if you ask me. But this message is here because I will assume (probably correctly) that I am the silly one, not Microsoft. So… is there something I’m missing? Why didn’t they include a “Find” method to this baby? The find could work on the Values, which are objects, so then I could do this:
someObject = SortedList.Values.Find(order => order.OrderID == orderID);
You might be looking for
.First(...)or.Single(...)(or theirOrDefaultvariants) in LINQ, but that only really works well with types that implementIEnumerable<T>. ASortedListis not strongly typed, hence the Lambda won’t work. Have a look at LINQ’s.Cast<T>().