C# lambda limit with include -


i have piece of code.

return folder.getallwithinclude(x => x.subfolder).take(5); 

this code returns 5 folder items. want limit subfolder 5 instead of limiting folder 5. have tried following

return folder.getallwithinclude(x => x.subfolder.take(5)); 

but doesn't seem trick.

i might missing proper syntax here.

thank in advance!

there's no method include(where expression). if using include load records.

update

you can use projection problem

folder.select(f => new         {             foldername = f.foldername,             subfolders = f.subfolders.take(5)         }).tolist().select(f => new folder()         {             foldername = f.foldername,             subfolders = f.subfolders         }; 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -