Hi, Lets look at the following structure first (I have tried to simplify it to just show what kind of query I want)
class NameAddress
{
public string Name { get; set; }
public string Address { get; set; }
public NameAddress(string sName, string sAddress) { Name = sName; Address = sAddress; }
}
static void Main(string[] args)
{
Dictionary<int, Dictionary<string, NameAddress>> _dictionary = new Dictionary<int,Dictionary<string,NameAddress>>()
{
{/*int Key=*/1, /*Dictionary<str, NameAddress> value(1)=*/new Dictionary<string, NameAddress>() { {"First", new NameAddress("John Doe", "Mexico")}} },
{/*int Key=*/2, /*Dictionary<str, NameAddress> value(2)=*/new Dictionary<string, NameAddress>() { {"Second", new NameAddress("Morris", "Washington")}, { "Third", new NameAddress("Keith", "New York")}} }
};
}
I want to query the following data structure using a single linq query. Let's say I want to find the guy who lives in New York and HIS key as well. The integer keys (_dictionary Keys) are not that important but the string Key (in this case - "Third") is the one that I want to find out.
Is it possible to find that the string Key and the particular NameAddress in a single linq query? If yes, what is that query?