I have these two lists, one a list of Venue Objects, one a list of BlockedVenues objects.
I need to filter each item in the listOfAllVenues so that it doesn't contain any venue
that is blocked
IQueryable<Venue> listOfAllVenues = MyDB.Venues;
IQueryable<BlockedVenue> listOfBlockedVenues = Mydb.BlockedVenue;
//I need something to accomplish this please
// var listOfAllVenues_WithoutBlocked_Venues =
( Select All venues from listOfAllVenues
where listOfAllVenues.ID is NOT in
listOfBlockedVenues.VenueID)
Please note that yes both list types are different, but listOfAllVenues has an int ID field, and listOfBlockedVenues has a VenueID int field, i need to use these two
Many Thanks
question from:
https://stackoverflow.com/questions/18977863/how-to-filter-a-list-based-on-another-list-using-linq 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…