c# - creating a new dictionary out of 2 matching ones -
labelmap = new dictionary<string, int>(); branchlinemap = new dictionary<string, int>();
if 1 key of first dictionary matches key of other dictionary need make new dictionary value of branchlinemap become key , value of labelmap become value. how do while iterating on whole dictionary?
using where
, todictionary
methods, can this:
var newdictionary = labelmap .where(x => branchlinemap.containskey(x.key)) .todictionary(x => branchlinemap[x.key], x => x.value);
Comments
Post a Comment