I have a Dictionary> in c#
Dictionary<string,List<string>> l_dictRawData;
which contains the values are :
KEYS VALUES
l_dictRawData["TamilNadu"] => VALUE[0] = "Chennai" VALUE[1] = "Madurai"
l_dictRawData["Andhra"] = > VALUE[0] = "Hyderabad" VALUE[1] = "Secundarabad"
l_dictRawData["Karnataka"] = > VALUE[0] = "mysore" VALUE[1] = "Bangalore"
Then i have the InputList
List<string> l_lstInput = new List<string>();
Which contains the data are :
l_lstInput[0] = "Hyderabad"
l_lstInput[1] = "Secundarabad"
The result will be the (i.e) if the dictionary l_dictRawData contains both "Hyderabad" and "Secundarabad" ,then select the KEy value .
string l_strOutPut = "Andhra";
Here is my code :
var Query = from l_strData in l_dictRawData
from l_strItem in l_lstInput
where l_strData .Value.Contains(l_strItem )
select new
{
CityName = l_strItem,
StateName = l_strData.Key
};
How can i get the ouput using LINQ in c#
If u have any queries plz let me know