Similar to this question but rephrased for Linq:
You can use Enumerable<T>.Any()
to test if the enumerable contains data. But what's the efficient way to test if the enumerable contains a single value (i.e. Enumerable<T>.Count() == 1
) or greater than a single value (i.e. Enumerable<T>.Count() > 1
) without using an expensive count operation?