c# if a list is empty code example
Example 1: c# tell if list object is empty
if(listOfObjects.Count == 0){
//when list is empty
}
Example 2: how to check a list is null or empty in c#
if ( (myList!= null) && (!myList.Any()) )
{
// Add new item
myList.Add("new item");
}