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.
If you want that all
d.Tagsshould be in the included in the_tagslist, you can try:If you want that
d.Tagsshould contain all the item from_tagsyou need:But I don’t know how it translates to SQL by EF so maybe you need to evaluate it on the client site.