111,113
社区成员




List<Product> products = new List<Product>();
list.Add(new Product {id= 1, Name = "A" ,Heigh=10, Width = 10, Length = 20, Suplier = "AA"});
list.Add(new Product {id= 2, Name = "A" ,Heigh=10, Width = 7, Length = 21, Suplier = "BB"});
list.Add(new Product {id= 3, Name = "A" ,Heigh=10, Width = 6, Length = 22, Suplier = "CC"});
list.Add(new Product {id= 4, Name = "A" ,Heigh=10, Width = 9, Length = 19, Suplier = "CC"});
//...
List<ProductSize> productSizes = list
.Select(p=>p.Suplier, p.Heigh, p.Width, p.Length)
.Where(p=>p.Suplier == "CC") as List<ProductSize>;
List<ProductSize> productSizes = list
.Select(p=>new ProductSize (){Suplier=p.Suplier, Heigh=p.Heigh, Width=p.Width, Length=p.Length})
.Where(p=>p.Suplier == "CC").ToList();
List<ProductSize> productSizes = list .Where(p=>p.Suplier == "CC").Cast<ProductSize>().Tolist();