I know it's an old question, but as of 2025, I'd solve it like this:
int count = myEnumerable?.Count() ?? 0;