AuditEntity.cs 1021 B

12345678910111213141516171819202122232425262728293031323334
  1. using System.ComponentModel.DataAnnotations;
  2. using System.ComponentModel.DataAnnotations.Schema;
  3. namespace MTWorkHR.Core.Entities.Base
  4. {
  5. public class AuditEntity: Entity, IAuditEntity
  6. {
  7. [Column(Order = 1)]
  8. [MaxLength(450)]
  9. public string? CreateUser { get; set; }
  10. [Column(Order = 2)]
  11. [MaxLength(450)]
  12. public string? UpdateUser { get; set; }
  13. [Column(Order = 3)]
  14. public DateTime CreateDate { get; set; }
  15. [Column(Order = 4)]
  16. public DateTime? UpdateDate { get; set; }
  17. }
  18. public class AuditEntity<TKey> : Entity<TKey>, IAuditEntity<TKey> where TKey : Type
  19. {
  20. [MaxLength(450)]
  21. [Column(Order = 1)]
  22. public string? CreateUser { get; set; }
  23. [MaxLength(450)]
  24. [Column(Order = 3)]
  25. public string? UpdateUser { get; set; }
  26. [Column(Order = 5)]
  27. public DateTime CreateDate { get; set; }
  28. [Column(Order = 6)]
  29. public DateTime? UpdateDate { get; set; }
  30. }
  31. }