码迷,mamicode.com
首页 > 其他好文 > 详细

dictionary 添加数据

时间:2016-07-01 11:47:12      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:

 
      

     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() > 0)
            {
                foreach (var item in empTempList)
                {
                    dict.Add(item.Personnel_ID, item.PersonName);
                }
            }
            ViewBag.EmpList = dict;

 

dictionary 添加数据

标签:

原文地址:http://www.cnblogs.com/yiran123456/p/5632425.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!