c# - Parsing nested dictionary with LINQ -


i have json object deserializing using newtonsoft.json dictionary<string, dictionary<string, string>>

i want parse dictionary<string, dictionary<double, int>> using linq struggling nested part.

for un-nested dictionaries using .todictionary(k => double.parse(k.key), k => int.parse(k.value))

thanks

        var input = new dictionary<string, dictionary<string, string>>();         input.add("test1", new dictionary<string, string>());         input["test1"].add("1.2", "3");          var output = input.todictionary(             x => x.key,              x => x.value.todictionary(                 y => double.parse(y.key),                  y => int.parse(y.value)             )         ); 

should trick.


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -