PostImage.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using Domain.Entities.Forum.Boards;
  2. using System.ComponentModel.DataAnnotations;
  3. using System.ComponentModel.DataAnnotations.Schema;
  4. namespace Domain.Entities.Forum.Posts
  5. {
  6. public class PostImage
  7. {
  8. [ForeignKey(nameof(BoardID))]
  9. public Board Board { get; set; } = null!;
  10. [ForeignKey(nameof(PostID))]
  11. public Post Post { get; set; } = null!;
  12. [Key]
  13. public int ID { get; set; }
  14. public int BoardID { get; set; }
  15. public int PostID { get; set; }
  16. public Guid UUID { get; set; } = Guid.NewGuid();
  17. public string FileName { get; set; } = default!;
  18. public string HashedName { get; set; } = default!;
  19. public string Path { get; set; } = default!;
  20. public string Url { get; set; } = default!;
  21. public string? Extension { get; set; }
  22. public string? ContentType { get; set; }
  23. public long? Size { get; set; }
  24. public short? Width { get; set; }
  25. public short? Height { get; set; }
  26. public bool IsDisabled { get; set; } = false;
  27. public DateTime? DisabledAt { get; set; }
  28. public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
  29. }
  30. }