IpLocation.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System.Collections.Generic;
  2. using Newtonsoft.Json;
  3. namespace IPLocationServerTool.Services
  4. {
  5. /// <summary>
  6. /// Ip Location server and areas
  7. /// </summary>
  8. public class IpLocation
  9. {
  10. public string ServerAdress { get; set; }
  11. public List<Continent> Areas { get; set; }
  12. }
  13. /// <summary>
  14. /// Continent
  15. /// </summary>
  16. public class Continent
  17. {
  18. public string Name { get; set; }
  19. public string Code { get; set; }
  20. [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
  21. public List<Country> Countrys { get; set; }
  22. }
  23. /// <summary>
  24. /// Country name
  25. /// </summary>
  26. public class Country
  27. {
  28. public string Name { get; set; }
  29. public string Code { get; set; }
  30. [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
  31. public List<State> States { get; set; }
  32. public Country()
  33. {
  34. States = new List<State>();
  35. }
  36. }
  37. /// <summary>
  38. /// State name
  39. /// </summary>
  40. public class State
  41. {
  42. public string Name { get; set; }
  43. public string Code { get; set; }
  44. [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
  45. public List<City> Cities { get; set; }
  46. public State()
  47. {
  48. Cities = new List<City>();
  49. }
  50. }
  51. /// <summary>
  52. /// City
  53. /// </summary>
  54. public class City
  55. {
  56. public string Name { get; set; }
  57. public string Code { get; set; }
  58. public City()
  59. {
  60. }
  61. }
  62. }