I have two dictionaries with the same structure:
Dictionary foo = new Dictionary()
{
{\"Table\", 5 },
{\"Chair
(from a in foo
join b in bar on a.Key equals b.Key
select new { Key = a.Key, Value = a.Value + b.Value })
.ToDictionary(a => a.Key,a => a.Value)
That should do it.
EDIT: Might be more efficient (not sure how the join is implemented)
(from a in foo
let b = bar.ContainsKey(a.Key) ? (int?)bar[a.Key] : null
select new { Key = a.Key, Value = a.Value + (b != null ? b : 0) }
).ToDictionary(a => a.Key, a => a.Value)