LINQ return items in a List that matches any Names (string) in another list
I have 2 lists. 1 is a collection of products. And the other is a collection of products in a shop. I need to be able to return all shopProducts if the names match any Names in the products. I have this but it doesn't seem to work. Any ideas? var products = shopProducts.Where(p => p.Name.Any(listOfProducts. Select(l => l.Name).ToList())).ToList(); I need to say give me all the shopproducts where name exists in the other list. var products = shopProducts.Where(p => listOfProducts.Any(l => p.Name == l.Name)) .ToList(); For LINQ-to-Objects, if listOfProducts contains many items then you might get