EntityChangeSet.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. using Abp.Domain.Entities;
  2. using Abp.Domain.Entities.Auditing;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel.DataAnnotations;
  6. using System.ComponentModel.DataAnnotations.Schema;
  7. namespace Abp.EntityHistory
  8. {
  9. [Table("AbpEntityChangeSets")]
  10. public class EntityChangeSet : Entity<long>, IHasCreationTime, IMayHaveTenant, IExtendableObject
  11. {
  12. /// <summary>
  13. /// Maximum length of <see cref="BrowserInfo"/> property.
  14. /// </summary>
  15. public const int MaxBrowserInfoLength = 512;
  16. /// <summary>
  17. /// Maximum length of <see cref="ClientIpAddress"/> property.
  18. /// </summary>
  19. public const int MaxClientIpAddressLength = 64;
  20. /// <summary>
  21. /// Maximum length of <see cref="ClientName"/> property.
  22. /// </summary>
  23. public const int MaxClientNameLength = 128;
  24. /// <summary>
  25. /// Maximum length of <see cref="Reason"/> property.
  26. /// </summary>
  27. public const int MaxReasonLength = 256;
  28. /// <summary>
  29. /// Browser information if this entity is changed in a web request.
  30. /// </summary>
  31. [StringLength(MaxBrowserInfoLength)]
  32. public virtual string BrowserInfo { get; set; }
  33. /// <summary>
  34. /// IP address of the client.
  35. /// </summary>
  36. [StringLength(MaxClientIpAddressLength)]
  37. public virtual string ClientIpAddress { get; set; }
  38. /// <summary>
  39. /// Name (generally computer name) of the client.
  40. /// </summary>
  41. [StringLength(MaxClientNameLength)]
  42. public virtual string ClientName { get; set; }
  43. /// <summary>
  44. /// Creation time of this entity.
  45. /// </summary>
  46. public virtual DateTime CreationTime { get; set; }
  47. /// <summary>
  48. /// A JSON formatted string to extend the containing object.
  49. /// </summary>
  50. public virtual string ExtensionData { get; set; }
  51. /// <summary>
  52. /// ImpersonatorTenantId.
  53. /// </summary>
  54. public virtual int? ImpersonatorTenantId { get; set; }
  55. /// <summary>
  56. /// ImpersonatorUserId.
  57. /// </summary>
  58. public virtual long? ImpersonatorUserId { get; set; }
  59. /// <summary>
  60. /// Reason for this change set.
  61. /// </summary>
  62. [StringLength(MaxReasonLength)]
  63. public virtual string Reason { get; set; }
  64. /// <summary>
  65. /// TenantId.
  66. /// </summary>
  67. public virtual int? TenantId { get; set; }
  68. /// <summary>
  69. /// UserId.
  70. /// </summary>
  71. public virtual long? UserId { get; set; }
  72. /// <summary>
  73. /// Entity changes grouped in this change set.
  74. /// </summary>
  75. public virtual IList<EntityChange> EntityChanges { get; set; }
  76. public EntityChangeSet()
  77. {
  78. EntityChanges = new List<EntityChange>();
  79. }
  80. }
  81. }