I have two type dictionaries
Dictionary<String, String> one = new Dictionary<string, string>
{
{ "A", "1" },
{ "B", "2" },
{ "C", "3" },
{ "D", "4" },
{ "E", "5" },
{ "F", "6" },
{ "G", "7" },
{ "H", "8" }
};
Dictionary<String, String> two = new Dictionary<string, string>
{
{ "A", "1" },
{ "B", "2" },
{ "C", "3" },
{ "E", "4" },
{ "F", "4" },
{ "I", "6" },
{ "J", "10" },
{ "K", "11" }
};
I need to combine two dictionaries at a key level, and then at a value level and add the resulting dictionary to a new dictionary three, the resulting dictionary should not have the same keys or the same values, in which case the resulting dictionary is like
Dictionary<String, String> three = new Dictionary<string, string>
{
{ "A", "1" },
{ "B", "2" },
{ "C", "3" },
{ "D", "4" },
{ "E", "5" },
{ "F", "6" },
{ "G", "7" },
{ "H", "8" },
{ "J", "10" },
{ "K", "11" }
};
Now i use as
- Combine all keys in two dictionaries
- Create a new dictionary with new keys
- delete duplicate values ββ(same values)
EDIT : if both dictionaries have the same key pair, then I need to save a pair of key values ββfrom the first dictionary.
Is there a way to do this using LINQ? thanks in advance