[Solved] How can i validate if List is empty? [duplicate]


You could use Any Or Count to check if the list is empty or not, like the following code :

if(listchannel == null || !listchannel.Any())
{
}

//Or 
if(listchannel == null || listchannel.Count == 0)
{
}

I hope you find this helpful.

4

solved How can i validate if List is empty? [duplicate]