I have 5 Values to add to a list. How can I make it cleaner with fewer lines of codes?
String[] values= new String[] { "AA", "BB", "CC", "DD", "EE", "FF" }; Values= new List<ValuesRow>(); foreach (var item in values) { Values.Add(new ValuesRow { Name = item, ID = 0 }); } public class ValuesRow { public String Name { get; set; } public String ID { get; set; } }