Can this method be rewritten using LINQ's query syntax?
public IEnumerable<Item> GetAllItems()
{
return Tabs.SelectMany(tab =>
{
tab.Pick();
return tab.Items;
});
}
I cannot figure out where to place tab.Pick()
method call.
No, query expressions in LINQ require each selection part etc to be a single expression, not multiple statements.
However, you could write a separate method:
Then use:
(Or whatever you want to do.)