I am trying to use .Any() to validate if a list of elements is empty but there is a possibility it contains null elements and returns true, which I don't want. Is there a way to validate a list is empty, ignoring nulls?
return salesList.Any() ? salesList : null;
The null values I sometimes have in the list prevent this from ever returning null.