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