string[] arID = {"0001","0002"};vardict =this.service.GetMyList(m=>arSatID.Contains(m.ID))//等同于SQL里的 idin('0001','0002')
.Select(m=>new{ m.ID, m.Name,m.Age })
.ToDictionary(s=>s.ID);//以ID作为key,{ID,Name,Age}作为Value,转化为Dictionary
foreach (varkvpindict)
{
string user ="姓名:"+ kvp.Value.Name;
}
...
继续阅读
(78)