Advertisement
Guest User

Untitled

a guest
Feb 27th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. public class TestRb
  2. {
  3.  
  4. public class Person
  5. {
  6. public string Name { get; set; }
  7. public int Age { get; set; }
  8. public Address Address { get; set; }
  9. }
  10.  
  11. public class Address
  12. {
  13. public string Street { get; set; }
  14. public string City { get; set; }
  15. }
  16.  
  17. public object Project(Person p)
  18. {
  19. return new
  20. {
  21. p.Name,
  22. p.Age,
  23. p.Address.Street,
  24. p.Address.City,
  25. };
  26. /*
  27. Instead of specifying maually all the fields, I would like to have
  28. return new
  29. {
  30. p.*,
  31. p.Address.*,
  32. };*/
  33. }
  34.  
  35. return p;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement