Gani tpt
asked on
LINQ - How to search list values from another multiple list.
Hi,
How to find and search list values which is available or not from multiple another lists.
For example,
List<string> FromList = new List<string>() { "Sub A", "Sub B" };
List<string> List1 = new List<string>() { "Sub A=80", "Sub D=70" };
List<string> List2 = new List<string>() { "Sub B=100", "Sub C=90" };
I want to take Fromlist and check this will be available or not in List1 and List2.
if it is available then it returns result as Sub A=80 and Sub B=100.
if it is not available in both list (List1 and List2) then it returns false.
How to form in LINQ Query..?
How to find and search list values which is available or not from multiple another lists.
For example,
List<string> FromList = new List<string>() { "Sub A", "Sub B" };
List<string> List1 = new List<string>() { "Sub A=80", "Sub D=70" };
List<string> List2 = new List<string>() { "Sub B=100", "Sub C=90" };
I want to take Fromlist and check this will be available or not in List1 and List2.
if it is available then it returns result as Sub A=80 and Sub B=100.
if it is not available in both list (List1 and List2) then it returns false.
How to form in LINQ Query..?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Code was tested and works as expected. Only solution provided
Open in new window