cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

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

saharin
Explorer | Level 4

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 11

Здравко
Legendary | Level 20

... in addition to Greg's advises: Migration to MonoDevelop may be considered. It's at the same time simplistic and feature rich IDE; ideal for start learning (and not only). Even more: its underlying platform - mono - is much more portable than original .NET! It's officially supported on Mac, Linux, and Windows only, but runs on any popular (or no so popular) OS. Take a look here how you can install on Windows.

Greg-DB
Dropbox Staff

@saharin Also, regarding "does not cause errors, but the list of cloud storage files does not print", are you referring to trying to list the contents without using "Where"? In that case, there are a few things to check:

  • Are you connected to the correct account that you expect to be accessing?
  • Are there actually any files/folders in that account? If you're using an app with the "app folder" access type, make sure there are files/folders in the app folder in particular.
  • What is ListFolderAsync returning? You may want to check the size of list.Entries, for instance. It can be helpful to use the debugger to inspect these values.
Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    saharin Explorer | Level 4
What do Dropbox user levels mean?