CreationAuditedEntityDto.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using Abp.Domain.Entities.Auditing;
  3. using Abp.Timing;
  4. namespace Abp.Application.Services.Dto
  5. {
  6. /// <summary>
  7. /// A shortcut of <see cref="CreationAuditedEntityDto"/> for most used primary key type (<see cref="int"/>).
  8. /// </summary>
  9. [Serializable]
  10. public abstract class CreationAuditedEntityDto : CreationAuditedEntityDto<int>
  11. {
  12. }
  13. /// <summary>
  14. /// This class can be inherited for simple Dto objects those are used for entities implement <see cref="ICreationAudited"/> interface.
  15. /// </summary>
  16. /// <typeparam name="TPrimaryKey">Type of primary key</typeparam>
  17. [Serializable]
  18. public abstract class CreationAuditedEntityDto<TPrimaryKey> : EntityDto<TPrimaryKey>, ICreationAudited
  19. {
  20. /// <summary>
  21. /// Creation date of this entity.
  22. /// </summary>
  23. public DateTime CreationTime { get; set; }
  24. /// <summary>
  25. /// Creator user's id for this entity.
  26. /// </summary>
  27. public long? CreatorUserId { get; set; }
  28. /// <summary>
  29. /// Constructor.
  30. /// </summary>
  31. protected CreationAuditedEntityDto()
  32. {
  33. CreationTime = Clock.Now;
  34. }
  35. }
  36. }