c# - how to create dictionary in with multiple values? -


I want to create a dictionary in C # with a key and several keys associated with the key. I also want to get the value based on the key. I suggested using a tube found on the internet people, but could not find a suitable example. How to use it and retrieve data?

Target: I want to parse a JSON response and want to store feedback in key pair form.

what are you asking

  dictionary & lt; Int, tuple & lt; Int, string & gt; & Gt;  

But what you should do is to create a class to replace that tuple

  the person in the public category {public entity id {get; Set;} public string first name {Get; Set;}}  

Then you can define your dictionary like this

  dictionary & lt; Int, person & gt; Bar = new dictionary & lt; Int, person & gt; ();  

Then you can retrieve such values ​​

  var firstName = bar [1] .FirstName // 1 is the key to item items  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -