Using a List in a where clause in Entity Framework
问题 I am trying to retrieve document id's over a one-to-many table. I want to use a List in the where clause to find all id's that are connected with every element in the list. List<int> docIds = (from d in doc where _tags.Contains(d.Tags) select d.id).ToList<int>(); I know that the contains must be incorrect but I can't work it out. If I try a foreach I can't work out how to check if the document contains all Tags. 回答1: If you want that all d.Tags should be in the included in the _tags list, you