private static ProfileInfoCollection ExtractProfileInfoFromRows(List<dynamic> rows, out int totalRecords) { var profiles = new ProfileInfoCollection(); totalRecords = 0; if (rows.Any()) { totalRecords = GetTotalRecords(rows); rows.ForEach(row => profiles.Add(CreateProfileInfo(row))); } return profiles; }