I have a empty Dictionary() and a function return another Dictionary(). I tried Concat and Union to merge both the dictionaries. But still i have no element in the Dictionary
var result = new Dictionary<string, AttributeValue>();
if (attributeModel.Ca.Client != null)
result.Concat(ConvertCaAttributeToDynamoDictionaryAttribute("Client", attributeModel.Ca.Client))
.GroupBy(i => i.Key)
.ToDictionary(group => group.Key, group => group.First().Value);
if (attributeModel.Ca.BusinessUnit != null)
result.Concat(ConvertCaAttributeToDynamoDictionaryAttribute("BusinessUnit", attributeModel.Ca.BusinessUnit));
return result;
I tried just dict.concat(anotherDict) or just dict.union(anotherDict) or just dict.concat(anotherDict).ToDictionary(). Also tried group by as written in the above code. But still the result doesn't have any element even my anotherDic have elements which means even if ConvertCaAttributeToDynamoDictionaryAttribute return dictionary with an element, my final value is empty dictionary. Any help is really appreciated