I need to know if there is a way to return all files and document sets in a recursive object.
I've written this code and it returns all folders and document sets but only as a flat list.
SPQuery query = new SPQuery();
query.Query = @"<Where>
<Eq>
<FieldRef Name='FSObjType' />
<Value Type='Lookup'>1</Value>
</Eq>
</Where>";
query.ViewAttributes = "Scope=\"RecursiveAll\""; // get both files and document sets
//query.ViewAttributes = "Scope=\"Recursive\""; // only fetches document sets
var result = list.GetItems(query);
Any advice?
Thanks