Tenor.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Newtonsoft.Json.Linq;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Web;
  6. namespace NEducation.Code
  7. {
  8. public class Tenor
  9. {
  10. public string status { get; set; }
  11. public string message { get; set; }
  12. public List<Category> listCategory { get; set; }
  13. public Tenor() { }
  14. public Tenor(string json) : this(JObject.Parse(json))
  15. { }
  16. public Tenor(JObject jObject)
  17. {
  18. if (jObject != null)
  19. {
  20. status = (string)jObject["status"];
  21. message = (string)jObject["message"];
  22. var list = jObject["LIST_CATEGORY"];
  23. if (list != null && list.HasValues)
  24. {
  25. listCategory = new List<Category>();
  26. JArray a = (JArray)list;
  27. foreach (JObject o in a.Children<JObject>())
  28. {
  29. listCategory.Add(new Category(o));
  30. }
  31. }
  32. }
  33. }
  34. }
  35. }