Class4.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using static wpf_data_json.models.Globals;
  7. using System.Threading.Tasks;
  8. using System.Collections.Generic;
  9. using wpf_data_json;
  10. using CsvHelper;
  11. using System.Diagnostics;
  12. using wpf_data_json.models;
  13. using static wpf_data_json.MainWindow;
  14. using System.IO;
  15. using System.Globalization;
  16. using System.Runtime.Serialization;
  17. namespace wpf_data_json.models
  18. {
  19. [DataContract]
  20. public class People
  21. {
  22. [DataMember]
  23. public string Name { get; set; }
  24. [DataMember]
  25. public int Age { get; set; }
  26. [DataMember]
  27. public int Price { get; set; }
  28. [DataMember]
  29. public string Gender { get; set; }
  30. [DataMember]
  31. public string Place { get; set; }
  32. [DataMember]
  33. public bool IsFavorite { get; set; }
  34. [DataMember(Name = "dateOfConnections")]
  35. private string? stringDate { get; set; }
  36. [IgnoreDataMember]
  37. public DateTime? dateOfConnections
  38. {
  39. get
  40. {
  41. return stringDate == null ? null : DateTime.Parse(stringDate);
  42. }
  43. set
  44. {
  45. stringDate = value.ToString();
  46. }
  47. }
  48. }
  49. }