I think you defined your GroupNames
as Dictionary
, so you need to add ToDictionary
like this:
GroupNames = GroupNames.Concat(AddedGroupNames)
.ToDictionary(x=>x.Key,x=>x.Value);
Note that 2 original dictionaries would have different keys, otherwise we need some rule to merge them correctly.