Guest User

Untitled

a guest
Aug 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. How do I combine Generic list of different types in to one generic custom list of type?
  2. Example:
  3. Public class Customer
  4. {
  5. long customerId{ get; set; }
  6. int titleId{ get; set; }
  7. string firstName{ get; set; }
  8. string middleName{ get; set; }
  9. int maritalStatusId { get; set; }
  10. }
  11.  
  12. public class Address
  13. {
  14. public long addressId{ get; set; }
  15. long customerId{ get; set; }
  16. short addressTypeId{ get; set; }
  17. string postCode{ get; set; }
  18. string geoCodeLattitude{ get; set; }
  19. string geoCodeLongitude{ get; set; }
  20. }
  21.  
  22. public class Account
  23. {
  24. long accountID{ get; set; }
  25. string accountDesc{ get; set; }
  26. short accountStatusID{ get; set; }
  27. DateTime joinDate{ get; set; }
  28. DateTime insertDateTime{ get; set; }
  29. }
  30.  
  31. <CustomerProfile>
  32. <Customer>
  33. <customerId>
  34. <titleId>
  35. <firstName>
  36. <middleName>
  37. <maritalStatusId>
  38. </Customer>
  39. <Address>
  40. <addressId>
  41. <customerId>
  42. <addressTypeId>
  43. <postCode>
  44. <geoCodeLattitude>
  45. <geoCodeLongitude>
  46. </Address>
  47. <Account>
  48. <accountID>
  49. <accountDesc>
  50. <accountStatusID>
  51. <joinDate>
  52. <insertDateTime>
  53. </Account>
  54. </CustomerProfile>
  55.  
  56. public class CustomerProfile
  57. {
  58. public Customer { get; set;}
  59. public Address { get; set;}
  60. public Account { get; set:}
  61. }
Add Comment
Please, Sign In to add comment