EntityChange.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using Abp.Domain.Entities;
  2. using Abp.Events.Bus.Entities;
  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("AbpEntityChanges")]
  10. public class EntityChange : Entity<long>, IMayHaveTenant
  11. {
  12. /// <summary>
  13. /// Maximum length of <see cref="EntityId"/> property.
  14. /// Value: 48.
  15. /// </summary>
  16. public const int MaxEntityIdLength = 48;
  17. /// <summary>
  18. /// Maximum length of <see cref="EntityTypeFullName"/> property.
  19. /// Value: 192.
  20. /// </summary>
  21. public const int MaxEntityTypeFullNameLength = 192;
  22. /// <summary>
  23. /// ChangeTime.
  24. /// </summary>
  25. public virtual DateTime ChangeTime { get; set; }
  26. /// <summary>
  27. /// ChangeType.
  28. /// </summary>
  29. public virtual EntityChangeType ChangeType { get; set; }
  30. /// <summary>
  31. /// Gets/sets change set id, used to group entity changes.
  32. /// </summary>
  33. public virtual long EntityChangeSetId { get; set; }
  34. /// <summary>
  35. /// Gets/sets primary key of the entity.
  36. /// </summary>
  37. [StringLength(MaxEntityIdLength)]
  38. public virtual string EntityId { get; set; }
  39. /// <summary>
  40. /// FullName of the entity type.
  41. /// </summary>
  42. [StringLength(MaxEntityTypeFullNameLength)]
  43. public virtual string EntityTypeFullName { get; set; }
  44. /// <summary>
  45. /// TenantId.
  46. /// </summary>
  47. public virtual int? TenantId { get; set; }
  48. /// <summary>
  49. /// PropertyChanges.
  50. /// </summary>
  51. public virtual ICollection<EntityPropertyChange> PropertyChanges { get; set; }
  52. #region Not mapped
  53. [NotMapped]
  54. public virtual object EntityEntry { get; set; }
  55. #endregion
  56. }
  57. }