public void GetMuscles(List<ListItem> selected)
{
int[] arrayOfStrings = new int[selected.Count];
for (int i = 0; i < selected.Count; i++)
{
arrayOfStrings[i] = Convert.ToInt32(selected[i].Value);
}
}
using (var db = new DWSEntities())
{
var muscles = (from m in db.Muscles
where m.MainMusleGroupID. //ISSUE
select new { m.MusleName, m.ID }).Take(40);
}
Run Code Online (Sandbox Code Playgroud)
在 where 语句中,我需要使用 contains 但在“.”之后。我没有选择使用包含。我用非整数值尝试了同样的方法,它出现了。我有一个整数数组,需要 WHERE IN 子句。那么有没有其他方法可以在没有包含的情况下做到这一点,或者我如何将包含与整数值一起使用?