我有下面的 linq 语句。没有循环我怎么能解决这个问题。这是一个标签系统,我只想要那些在“myints”中具有带有 ids 的标签的练习
int[] myints = {1,2};
foreach (int tagid_temp in myints)
{
ExerciseByTagId =
(from exercise in context.ExerciseSet
where context.ItemsTagsSet
.Where(a => a.TagsId == tagid_temp)
.Select(a => a.ExerciseId).Contains(exercise.Id)
select exercise);
}