How do I retrieve items that are tagged with all the supplied tags in linq?
问题 I seem to be having trouble with this. I have a Task table with an ID, and a Tag table, that has a tag field and a foreign key constraint to the task table. I want to be able to perform AND searches for tasks by tags. So for example, if I search for tasks with the tags "portability" and "testing", I don't want tasks that are tagged with "portability" and not "testing". I tried the following syntax: var tasks = (from t in _context.KnowledgeBaseTasks where t.KnowledgeBaseTaskTags.Any(x => tags