List指定字段赋特定值(非循环) asp.net

 List<Cart> cartd=cartd.Where(p => (p.Id= "123").Length > -1).ToList();

把Id的值都赋值为123

还有循环的方法就不写了

原文地址:https://www.cnblogs.com/loveheyi/p/5070647.html