dictionary 添加数据

     var empList = from p in customers
select new
{
p.Personnel_ID,
p.PersonName
};
var empTempList = empList.Distinct().ToList();
Dictionary<string, string> dict = new Dictionary<string, string>();
if (empTempList != null && empTempList.Count() > )
{
foreach (var item in empTempList)
{
dict.Add(item.Personnel_ID, item.PersonName);
}
}
ViewBag.EmpList = dict;
上一篇:Linux2.6 内核中结构体初始化(转载)


下一篇:C#中Skip和Take的用法