I get objects which have 2 main properties – an outer key (int) and a dictionary that is keyed by a string with list of values.
Internal keys (A/B in the example) are supposed to be unique for each outer key (1).
This needs to be optimised for .net 8 with the following considerations – the code is run a few times a second and there are about 20 outer keys and 3-5 internal keys and value lists are about 100 elements each
v1 = new { Key = 1, D = new Dictionary<string, List<double>> { new {"A", new { 10, 11 } } } };
v1 = new { Key = 1, D = new Dictionary<string, List<double>> { new {"B", new { 20, 22 } } } };
expected result : Dictionary<int, Dictionary<string, List<double>> ->
{ 1, { { "A", {10,11} }, { "B", {20,22} } }}