list.ForEach的用法

Templist.ForEach(o =>
{
   var isSel = ReviewerFileRelationService.Where(s => s.PackageFileId == o.Id && s.ReviewerId == o.ContactId).AsQueryable().FirstOrDefault();
   if (isSel != null)
   {
       o.Contact = "<input type=\"checkbox\" checked onchange='set(this)' class=\"chk\" id=\"" + o.Id + "_" + o.ContactId + "\" /><label for=\"" + o.Id + "_" + o.ContactId + "\" >" + o.UserName + "</label> ";
   }
   else
   {
       o.Contact = "<input type=\"checkbox\" onchange='set(this)' class=\"chk\" id=\"" + o.Id + "_" + o.ContactId + "\" /><label for=\"" + o.Id + "_" + o.ContactId + "\" >" + o.UserName + "</label> ";
   }
});

 

posted @ 2015-03-31 15:16  小姐,请叫我“序员”好吗  阅读(2192)  评论(2编辑  收藏  举报