how to check if a list is null in c# code example
Example 1: c# tell if list object is empty
if(listOfObjects.Count == 0){
//when list is empty
}
Example 2: c# list contains null
if (myList.Any(i => i != null))
{
DoSomeThing();
}
if(listOfObjects.Count == 0){
//when list is empty
}
if (myList.Any(i => i != null))
{
DoSomeThing();
}