开发者

Linq merge statement needed

Hi I would like a Linq statement to Convert List<IQueryable<Object>> to a List<Object> I am returning a List<IQueryable<Object>> so I can use where on the Iquerable part but I can figure that out on my own "I Hope". If the question is too vague I can give you more details if needed.

This is the best I can explain it. I run a for loop and each iteration I get an IQuerable<ITagLink> now I tried to union it but it does'nt work cos each iteration is a different type i.e. a different objects but it implements ITaglink but this is not important. I decieded to add this to a list. Now I have a list of IQuerable&l开发者_如何学Pythont;ITagLink> but I would rather have each ITaglink in the List<IQueryable<ITagLink>> placed in another list<ITagLink> but I would like a linq statement to do this. P.S I'm not sure what flattening is but I'm gonna google it now.


You want all of the objects from all the IQueryable<object>s, right?

list.SelectMany(x => x);

If you really need that to be a List<object>, add .ToList()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜