c# ienumerable is empty code example
Example 1: check if ienumerable is empty c#
IEnumerable<T> enumerable = new List<int>();
if(!enumerable.Any())
{
throw new InvalidOperationException();
}
Example 2: c# empty IEnumerable
using System.Linq;
...
Enumerable.Empty<Friend>();