List<Customer> c= new List<Customer>()
{
new Customer{Id = 1, Name = "Bruce"},
new Customer{Id = 2, Name = "John"}
};
I just know
c.ForEach(o => str += o.Id.ToString() + ",");
Any ways to make it simple?
I just wanna get Id out and make Ids array int[] Ids = new {Id = 1, Id = 2}
If you want to create an array with all those ids then you can use
SelectandToArraymethods :