Entity.cs 530 B

12345678910111213141516171819202122
  1. using System.ComponentModel.DataAnnotations.Schema;
  2. using System.ComponentModel.DataAnnotations;
  3. namespace MTWorkHR.Core.Entities.Base
  4. {
  5. public class Entity : IEntity
  6. {
  7. [Key]
  8. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  9. [Column(Order = 0)]
  10. public long Id { get; set; }
  11. }
  12. public class Entity<TKey> : IEntity<TKey>
  13. {
  14. [Key]
  15. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  16. [Column(Order = 0)]
  17. public TKey Id { get; set; }
  18. }
  19. }