CommentFile.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 CommentFile
  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; }
  21. public string FileName { get; set; } = default!;
  22. public string HashedName { get; set; } = default!;
  23. public string Path { get; set; } = default!;
  24. public string Url { get; set; } = default!;
  25. public string? Extension { get; set; }
  26. public string? ContentType { get; set; }
  27. public long? Size { get; set; } = 0;
  28. public int Downloads { get; set; } = 0;
  29. public bool IsDisabled { get; set; } = false;
  30. public DateTime? DisabledAt { get; set; }
  31. public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
  32. }
  33. }