Join two dictionaries using a common key

前端 未结 4 996
广开言路
广开言路 2021-02-09 23:28

I am trying to join two Dictionary collections together based on a common lookup value.

var idList = new Dictionary();
idList.Add(1, 1);
idList.A         


        
4条回答
  •  爱一瞬间的悲伤
    2021-02-09 23:53

            var q = from id in idList
                    join entry in lookupList
                      on id.Key equals entry.Key
                    select entry.Value;
    

    Your desired linq statement will look like that, ID and Entry needed to be switched around on the condition.

提交回复
热议问题