using System.Collections.Generic;
public static void Main()
var orgModule = new Dictionary<string, string>
{ "TEST", "TEST_VALUE_**" },
{ "TEST_A", "TEST_VALUE_A" }
var homeModule = new Dictionary<string, string>
{ "test", "TEST_VALUE2" },
{ "TEST_B", "TEST_VALUE_B" }
var getLocalTextResult = new Dictionary<string, Dictionary<string, string>>
var localTextItems = getLocalTextResult
.SelectMany(x => x.Value).Select(x => x)
.ToLookup(pair => pair.Key, pair => pair.Value)
.ToDictionary(group => group.Key, group => group.FirstOrDefault(), StringComparer.OrdinalIgnoreCase);
foreach (var entry in localTextItems)
Console.WriteLine(entry.Key + " " + entry.Value);
Console.WriteLine("error");
Console.WriteLine("*****");
var localTextItems2 = getLocalTextResult
.SelectMany(x => x.Value).Select(x => x)
.ToLookup(pair => pair.Key.ToUpper(), pair => pair.Value)
.ToDictionary(group => group.Key, group => group.FirstOrDefault(), StringComparer.OrdinalIgnoreCase);
foreach (var entry in localTextItems2)
Console.WriteLine(entry.Key + " " + entry.Value);