techblog

Schema.Net-Complex-Sample

Feb 14th, 2018
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.93 KB | None | 0 0
  1. // Single string address
  2. var organization = new Organization()
  3. {
  4.     Address = "123 Old Kent Road E10 6RL"
  5. };
  6.  
  7. // Multiple string addresses
  8. var organization = new Organization()
  9. {
  10.     Address = new List<string>()
  11.     {
  12.         "123 Old Kent Road E10 6RL",
  13.         "456 Finsbury Park Road SW1 2JS"
  14.     }
  15. };
  16.  
  17. // Single PostalAddress address
  18. var organization = new Organization()
  19. {
  20.     Address = new PostalAddress()
  21.     {
  22.         StreetAddress = "123 Old Kent Road",
  23.         PostalCode = "E10 6RL"
  24.     }
  25. };
  26.  
  27. // Multiple PostalAddress addresses
  28. var organization = new Organization()
  29. {
  30.     Address = new List<PostalAddress>()
  31.     {
  32.         new PostalAddress()
  33.         {
  34.             StreetAddress = "123 Old Kent Road",
  35.             PostalCode = "E10 6RL"
  36.         },
  37.         new PostalAddress()
  38.         {
  39.             StreetAddress = "456 Finsbury Park Road",
  40.             PostalCode = "SW1 2JS"
  41.         }
  42.     }
  43. };
Advertisement
Add Comment
Please, Sign In to add comment