var test2NotInTest1 = test2.Where(t2 => test1.Count(t1 => t2.Contains(t1))==0);
Faster version as per Tim’s suggestion:
var test2NotInTest1 = test2.Where(t2 => !test1.Any(t1 => t2.Contains(t1)));
More Related Contents:
- Simultaneous equations in C# LINQ [closed]
- Get All instead of FirstOrDefault
- How to write this nested foreach loop query in LINQ?
- Group by in LINQ
- Linq: GroupBy, Sum and Count
- LINQ to Entities does not recognize the method ‘System.String ToString()’ method, and this method cannot be translated into a store expression
- Find an item in a list by LINQ
- How to Count Duplicates in List with LINQ
- How do I find the text within a div in the source of a web page using C#
- Combination of List
- LINQ Select Distinct with Anonymous Types
- LINQ Orderby Descending Query
- Equivalent of SQL ISNULL in LINQ?
- How to get the closest number from a List with LINQ?
- Multiple Order By with LINQ [duplicate]
- Extension methods syntax vs query syntax
- Conversion from List to array T[]
- ILookup vs. IGrouping
- Enumerating Collections that are not inherently IEnumerable?
- Comparing 2 objects and retrieve a list of fields with different values
- C# Linq where clause as a variable
- Find if listA contains any elements not in listB
- Find all child controls of specific type using Enumerable.OfType() or LINQ
- How to merge a list of lists with same type of items to a single list of items?
- Split an IEnumerable into fixed-sized chunks (return an IEnumerable where the inner sequences are of fixed length) [duplicate]
- Remove item from list based on condition
- Linq OrderBy against specific values
- What is the best way to check two List lists for equality in C#
- Linq access property by variable
- LINQ Query to Convert string to datetime