var filtered = listOfAllVenues .Where(x=>!listOfBlockedVenues.Any(y=>y.VenueId == x.Id));
It will get all Venues where Id is not in blockedVenues list
As of NET 6, you can use
var filtered = allVenues.ExceptBy(blockedVenues.Select(x => x.VenueID), venue => venue.ID);
This will get all venues except those whose ID is in
blockedVenues.Select(x => x.VenueID)
- How to filter a list based on another list using Linq?
- Using LINQ to filter a list of items based on those items' presence in another list
- Using Linq to object, how can I get one field's value based on another in the same list
- How to filter linq query based on all of the values of one property from another list
- How to filter a list by comparing a value from another list using Linq in C#?
- How do optimize nested loop and filter from another list using linq c#
- How do i filter one list from another list using linq
- c# How to get count of value in a List based on value in another List using LINQ
- How to set order of IQueryable query based on another list using linq in c#?
- Filter a list based on another list containing IEnumerable<Guid> using linq
- In C#, how can I filter a list using a StartsWith() condition of another list?
- How to generate a unique list of items from another list using LINQ in C#
- How to fill a property of an object from another list using LINQ
- How to filter list in asp.net/vb.net using linq
- LINQ Filter results based on values between another list
- How can I filter a list using generics and Linq extension methods?
- Filter Out List with another list using LINQ
- How to update a list based on more than one Condition using LINQ C#
- How to order list of string based on StatrtWith using LINQ
- Filter a list of objects using a property that is another list. Using linq
- Linq filter a list of objects based on another list
- Filter one list using index value obtained from another list using linq
- How do you filter a list based on matching items in another list?
- how to filter list in c# using linq
- How to filter a list using LINQ when the list has same properties?
- Using Linq to Filter a List of Objects based on a Condition
- How to filter object list with LINQ without using nested If statement
- How to build List by using data from another List using LINQ
- How to change values of few properties from one list to another using LINQ C#:
- How to filter on a list of keys in a Dictionary using LINQ
More Query from same tag
- LINQ Join needed?
- LINQ with multiple selection and group by multiple selection
- Calling an async method with `.Result` in a Linq expression causes deadlock
- "Cannot convert lambda expression to type 'string' because it is not a delegate type" querying dataset in C#
- Linq query takes too long when using Func & OrderByDescending
- Why doesn't the Lookup that results from GroupBy have Lookup properties?
- How to add an item to a Mock DbSet (using Moq)
- Returning custom object in LINQ query
- Keeping sibling reference while combining items
- How to get Distinct Values from List(Of T) using Linq
- How to do multiple split values from a list of string to an object, blows if there is no string to split
- C# lambda get distinct list of value conditionally
- convert code to use Linq
- Linq query - get first object of related entity
- Cannot implicitly convert type '.List<AnonymousType#1>' to '.List<WebApplication2.Customer>'
- Is this query being executed on an in-memory collection, or in the database?
- the entity or complex type 'yyyx_datamodel.paytypes' cannot be constructed in a linq to entities query
- LINQ get items in List<AttributeValuePair>
- How to put a condition in the select of linq in C#
- Simple update with Entity Framework
- Purpose of EF 6.x DbContext Generator option when adding a new data item in Visual Studio
- checking for null in lambda expression - linq
- Linq Group By Object Then Select
- What's wrong with the joins in this LINQ query?
- Relating More than two tables through foreign keys
- Linq and Lambda expression for a complex sql query involving joins
- Search IList object without case sensitive using Linq
- Can I "stop" a LINQ method chain midway?
- how to return array from linq?
- Full join in Linq