I have to check, if directory on disk is empty. It means, that it does not contain any folders/files. I know, that there is a simple method. We get array of FileSystemInfo\'
Since you are going to work with a DirectoryInfo object anyway, I'd go with an extension
public static bool IsEmpty(this DirectoryInfo directoryInfo) { return directoryInfo.GetFileSystemInfos().Count() == 0; }