using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
List<Customer> custList = new List<Customer>();
custList.Add(new Customer { Name = "P1" });
custList.Add(new Customer { Name = "P2" });
custList.Add(new Customer { Name = "P3" });
custList.Add(new Customer { Name = "P4" });
custList.Add(new Customer { Name = "P5" });
List<Customer> vendorList = new List<Customer>();
vendorList.Add(new Customer { Name = "P1" });
vendorList.Add(new Customer { Name = "P2" });
//var v = custList.SelectMany(
}
}
public class Customer
{
public string Name { get; set; }
}
}
How do i copare these 2 lists and find only those customers who are present in custList as well as vendorList?
From a comment to another answer:
In this case, you may wish to utilize
Join. Such as