This should be easily resolved by using
Cast<SftpItem>()
method as in the code below:
Rebex.Net.SftpItemCollection sftpItemCollection = sftp.GetList(path);
foreach (var item in sftpItemCollection.Cast<SftpItem>().Where(i => i.IsFile == true))
{
Console.WriteLine(item.Name);
}
Sorry for inconvenience! This is because SftpItemCollection now implements both
IEnumerable<SftpItem> and
IEnumerable<FileSystemItem>
(the latter one being part of the common IFtp API), so casting SftpItemCollection explicitly to IEnumerable<sftpitem> might be necessary in order to use the proper LINQ extension methods.