I have an IEnumerable sequence that is lazy loaded from a Stream. It's possible that the steam might be very large (think GBs).
I need to know if the sequence contains exactly one element. Checking if .Count() == 1 is not efficient because it would enumerate the entire list by reading the complete stream. Using .Any is not useful because I need to know if it contains exactly one element, not that it contains any elements.
Possible solution
Would .Take(2).ToList() and then do a count be the most efficient way to check if a sequence contains exactly one element?