CommentImage.cs 1.4 KB

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