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
Post a Comment