var nodes = (from n in db.Nodes
join st in db.SessionTrackings on n.NodeID equals st.NodeID
where st.UserID == userid && st.GroupID == groupid
select n);
IDictionary<int, bool> trackingData = new Dictionary<int, bool>();
foreach (Node n in nodes)
{
trackingData.Add(new KeyValuePair<int, bool>(n.ID, true));
}
I keep getting a 'that key was already added' because there could be many SessionTrackings per Node, however I just want to get back all the Nodes that have at least 1 SessionTracking in existence for the NodeID but I don't need to get the Nodes more than once. If there are 4000 SessionTrackings for a Node (say ID = 45) I still only one 1 instance of Node 45 in my IQueryable. How can I modify my query for this? Please don't worry about why I need it in a Dictionary that's just the way it is.