CacheResponseData.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Muchinfo.MTPClient.Infrastructure.Cache
  4. {
  5. /// <summary>
  6. /// 缓存回应数据类
  7. /// </summary>
  8. public class CacheResponseData
  9. {
  10. #region Fields
  11. /// <summary>
  12. /// 缓存时间
  13. /// </summary>
  14. private readonly DateTime _cacheTime;
  15. //考虑不要使用嵌套泛型的设计
  16. private readonly List<Dictionary<string, string>> _dataCollection;
  17. #endregion Fields
  18. #region Constructors
  19. /// <summary>
  20. /// Initializes a new instance of the <see cref="CacheResponseData"/> class.
  21. /// </summary>
  22. /// <param name="cacheTime">缓存时间</param>
  23. public CacheResponseData(DateTime cacheTime)
  24. {
  25. this._dataCollection = new List<Dictionary<string, string>>();
  26. this._cacheTime = cacheTime;
  27. }
  28. #endregion Constructors
  29. #region Properties
  30. #region Public Properties
  31. /// <summary>
  32. /// 获取缓存时间
  33. /// </summary>
  34. public DateTime CacheTime
  35. {
  36. get { return this._cacheTime; }
  37. }
  38. /// <summary>
  39. /// 获取缓存的字段值
  40. /// </summary>
  41. public List<Dictionary<string, string>> DataCollection
  42. {
  43. get { return this._dataCollection; }
  44. }
  45. #endregion Public Properties
  46. #endregion Properties
  47. }
  48. }