I have two Generic Lists containing different types, for the sake of example, lets call them Products
and Employees
. I'm trying to find Products that are based at the same location as Employees, i.e. where product.SiteId == emp.SiteId
List<Product> lstProds;
List<Employees> lstEmps;
My (old skool) brain is telling me to use a forEach
loop to find the matches but I suspect there is a ('better'/terser/faster?) way to do it using Linq. Can anyone illuminate me? All the examples I've found online deal with Lists of primitives (strings/ints) and are not especially helpful.