find element in list not in another list c#
var result = peopleList2.Where(p => !peopleList1.Any(p2 => p2.ID == p.ID));
find element in list not in another list c#
var result = peopleList2.Where(p => !peopleList1.Any(p2 => p2.ID == p.ID));
check list exist in list c# if matches any
List<int> nums1 = new List<int> { 2, 4, 6, 8, 10 };
List<int> nums2 = new List<int> { 1, 3, 6, 9, 12};
if (nums1.Any(x => nums2.Any(y => y == x)))
{
Console.WriteLine("There are equal elements");
}
else
{
Console.WriteLine("No Match Found!");
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us