Guest User

Untitled

a guest
Jun 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. public class IdRetriever {
  2.  
  3. private IEnumerable<Person> people;
  4.  
  5. public IdRetriever(IEnumerable<Person> people){
  6. this.people = people;
  7. }
  8.  
  9. public IEnumerable<int> GetIds(){
  10. return GetTheIds()
  11. .Select(x=>(int)x.Id);
  12. }
  13.  
  14. private IEnumerable<dynamic> GetTheIds(){
  15. return people.Select(x=>new {Id = x.Id});
  16. }
  17.  
  18. }
Add Comment
Please, Sign In to add comment