Answers for "ienumerable is empty"

C#
2

c# empty IEnumerable

using System.Linq;
...
Enumerable.Empty<Friend>();
Posted by: Guest on May-15-2020
0

check that IEnumerable is not empty

public static class Utils {
    public static bool IsAny<T>(this IEnumerable<T> data) {
        return data != null && data.Any();
    }
}
Posted by: Guest on March-27-2022

C# Answers by Framework

Browse Popular Code Answers by Language