IQeryable<Line>. If you do not save its result, it will run every time you select from it. If
Line does not override
==, that will create different objects each time, so
Except cannot remove the previous object from new objects.
Now, a lot is missing, but try:
var linesList = lines.ToList(); // get results ones var hasX = lines.Where(line => line.Content.Contains('x')); var noX = lines.Except(hasX);
Alright. All I needed to do is to implement
- IQueryable .Except() is not resulting what I expect!
- linq 'not in' query not resolving to what I expect
- Linq Where clause not returning what I expect when performing String.Contains(String) on a null string
- Linq Find Partial Text Match - Included code returns duplicate and everything except what it should
- Any() not giving what I would expect
- What can I do to resolve a "Row not found or changed" Exception in LINQ to SQL on a SQL Server Compact Edition Database?
- The data source does not support server-side data paging
- What does this C# code with an "arrow" mean and how is it called?
- What is the best way to check IQueryable result set is null
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- Using Linq Except not Working as I Thought
- This code returns distinct values. However, what I want is to return a strongly typed collection as opposed to an anonymous type
- IQueryable does not contain definition for GetAwaiter
- Enumerable.Empty<T>().AsQueryable(); This method supports the LINQ to Entities infrastructure and is not intended to be used directly from your code
- Visual Studio Code Analysis Rule - "Do not expose generic lists"
- Why is this code with PredicateBuilder not working?
- Forcing Entity Framework to not generate NCLOB's when building Linq-to-Sql Code (Model First)
- Execute expression on another IQueryable source
- LINQ Source Code Available
- Where clause not working on LINQ IQueryable query
- What to put as the Provider for a mocked IQueryable
- Refactor Linq code and "LINQ to Entities does not recognize the method"
- .NET 4 Code Contracts: "requires unproven: source != null"
- LINQ Query Except not working, List<long?> vs. List<long>
- Haven't jumped on the Linq bandwagon, what are your reasons for not using linq?
- What is the difference between ((IEnumerable)source).OfType<T>() and source as IEnumerable<T>
- linq - how do you do a query for items in one query source that are not in another one?
- IQueryable does not contain ToList()
- IQueryable methods are not resolved for dynamic query variable
- .net IEnumerable Except with custom IEqualityComparer not working as expected
More Query from same tag
- Execute Stored Procedure with XMl datatype in Entity model
- Search by string field name
- Linq2XML separate keys into List
- c# is it faster to concatenate lists and then filter or filter then concatenate
- Upgraded to .NET Core 3.1 and receiving an error in a LINQ query related to using .FirstOrDefault()
- Store values into object of object through SQL Query using linq to entity
- How to code an Or extension method
- Linq date and datetime comparer
- SubQuery to a local list using ObjectQuery
- Icomparer c# List
- Solution to rank positions in my LIST?
- Skip Function repeating values while appending in View
- join table to table related to the parent table
- CRM LINQ Composite join "The method 'Join' is not supported" error
- GridView ObjectDataSource LINQ Paging and Sorting using multiple table query
- Saved projection expression for re-use in different linq expressions with two source objects
- How to write this query as lambda expression?
- mvc 4 IEnumerable checking if its null
- Merging 2 lists and sum several properties using LINQ
- find list elements which are similar to other list elements by 3 properties and then add value from the second one to the first
- Compare two lists - If any objects property in one list have changed or a new object in list been added, return that object
- Higher order function in VB.NET (Select) gives me a "Select is not a member of [...]"
- How to take value based on previous node from the given xml file
- Error when using "Include" method on a LINQ Query
- XDocument to dataSet, my nested nodes are getting treated as new tables?
- How to find elements from 1 collection which partially matches elements in a second collection?
- c#.NET LinQ - sorting subsets of a list of objects
- Query Efficiency .contains
- Best way to write this in Linq