List<int> numbers = records.GetNumbers();
In a public static class:
public static class DataExtension { public static List<int> GetNumbers(this IEnumerable<CustomRecord> records) { var numbers = new List<int>(); foreach (var record in records) { numbers.Add(record.Number); } return numbers; } }
No comments:
Post a Comment