Entity.cs 615 B

123456789101112131415161718192021222324252627282930313233
  1. using FreeSql.DataAnnotations;
  2. using System.ComponentModel;
  3. namespace Admin.Core.Common.BaseModel
  4. {
  5. public interface IEntity<TKey>
  6. {
  7. /// <summary>
  8. /// 主键Id
  9. /// </summary>
  10. TKey Id { get; set; }
  11. }
  12. public interface IEntity : IEntity<long>
  13. {
  14. }
  15. public class Entity<TKey> : IEntity<TKey>
  16. {
  17. /// <summary>
  18. /// 主键Id
  19. /// </summary>
  20. [Description("主键Id")]
  21. [Column(Position = 1, IsIdentity = true)]
  22. public virtual TKey Id { get; set; }
  23. }
  24. public class Entity : Entity<long>
  25. {
  26. }
  27. }