List<Customer> c= new List<Customer>()
{
new Customer{Id = 1, Name = "Bruce"},
new Customer{Id = 2, Name = "John"}
};
我只知道
c.ForEach(o => str += o.Id.ToString() + ",");
有什么方法可以让它变得简单吗?
我只想让 Id 出来并制作 Ids 数组 int[] Ids = new {Id = 1, Id = 2}