PostImage.cs 1.1 KB

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