Reputation: 2882
I have three tables : Tool, Color and ColorTool. ColorTool has 3 columns : the id (auto increment) and IdTool + IdColor.
I have a List<Tool>
and my goal is to retrieve a List<Color>
or a List<int>
(just the IdColor).
My last try :
var colorList = (from res in toolList select res.ToolColor.ToList()).ToList();
In this case colorList is a List of List of ToolColor.
I don't know how retrieve that data. Can someone help me ? I use nhibernate 3.1 ?
Regards
Upvotes: 0
Views: 113
Reputation: 479
How about
from res in toolList
from toolColor in res.ToolColor
select toolColor.Color
?
Upvotes: 1