Forum Discussion

saharin's avatar
saharin
Explorer | Level 4
3 years ago

Dropbox api. not worked foreach (var item in list.Entries.Where(i => i.IsFolder))

I want to use the dropbox api. I use the code from this page - https://www.dropbox.com/developers/documentation/dotnet#tutorial .

But in my Visual.Studio throws an error -
CS1061 "IList<Metadata>" does not contain a definition of "Where", and it was not possible to find an available "Where" extension method that accepts the type "IList<Metadata>" as the first argument (perhaps the using directive or assembly reference was omitted).
Why doesn 't it recognize WHERE ?

 

Code:

async Task ListRootFolder(DropboxClient dbx)
{
var list = await dbx.Files.ListFolderAsync(string.Empty);

// show folders then files
foreach (var item in list.Entries.Where(i => i.IsFolder))
{
Console.WriteLine("D {0}/", item.Name);
}

foreach (var item in list.Entries.Where(i => i.IsFile))
{
Console.WriteLine("F{0,8} {1}", item.AsFile.Size, item.Name);
}
}

11 Replies

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!