List<int> unitIDList=new List<int>();
//此处添加int元素
var query = DB.ElecConsumers.Where(c => unitIDList.Contains(c.ParentUnitID));
//EF方式
var query1 = (from c in DB.ElecConsumers where unitIDList.Contains(c.ParentUnitID ) select c);
//Linq方式
2024-02-05 16:12:40
List<int> unitIDList=new List<int>();
//此处添加int元素
var query = DB.ElecConsumers.Where(c => unitIDList.Contains(c.ParentUnitID));
//EF方式
var query1 = (from c in DB.ElecConsumers where unitIDList.Contains(c.ParentUnitID ) select c);
//Linq方式