NameValueDto.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. using System;
  2. namespace Abp.Application.Services.Dto
  3. {
  4. /// <summary>
  5. /// Can be used to send/receive Name/Value (or Key/Value) pairs.
  6. /// </summary>
  7. [Serializable]
  8. public class NameValueDto : NameValueDto<string>
  9. {
  10. /// <summary>
  11. /// Creates a new <see cref="NameValueDto"/>.
  12. /// </summary>
  13. public NameValueDto()
  14. {
  15. }
  16. /// <summary>
  17. /// Creates a new <see cref="NameValueDto"/>.
  18. /// </summary>
  19. public NameValueDto(string name, string value)
  20. : base(name, value)
  21. {
  22. }
  23. /// <summary>
  24. /// Creates a new <see cref="NameValueDto"/>.
  25. /// </summary>
  26. /// <param name="nameValue">A <see cref="NameValue"/> object to get it's name and value</param>
  27. public NameValueDto(NameValue nameValue)
  28. : this(nameValue.Name, nameValue.Value)
  29. {
  30. }
  31. }
  32. /// <summary>
  33. /// Can be used to send/receive Name/Value (or Key/Value) pairs.
  34. /// </summary>
  35. [Serializable]
  36. public class NameValueDto<T> : NameValue<T>
  37. {
  38. /// <summary>
  39. /// Creates a new <see cref="NameValueDto"/>.
  40. /// </summary>
  41. public NameValueDto()
  42. {
  43. }
  44. /// <summary>
  45. /// Creates a new <see cref="NameValueDto"/>.
  46. /// </summary>
  47. public NameValueDto(string name, T value)
  48. : base(name, value)
  49. {
  50. }
  51. /// <summary>
  52. /// Creates a new <see cref="NameValueDto"/>.
  53. /// </summary>
  54. /// <param name="nameValue">A <see cref="NameValue"/> object to get it's name and value</param>
  55. public NameValueDto(NameValue<T> nameValue)
  56. : this(nameValue.Name, nameValue.Value)
  57. {
  58. }
  59. }
  60. }