CommentFile.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. public class CommentFile
  7. {
  8. [ForeignKey(nameof(BoardID))]
  9. public virtual Board Board { get; set; } = null!;
  10. [ForeignKey(nameof(PostID))]
  11. public virtual Post Post { get; set; } = null!;
  12. [ForeignKey(nameof(CommentID))]
  13. public virtual Comment Comment { get; set; } = null!;
  14. [Key]
  15. public int ID { get; set; }
  16. public int BoardID { get; set; }
  17. public int PostID { get; set; }
  18. public int CommentID { get; set; }
  19. public Guid UUID { get; set; }
  20. public string FileName { get; set; } = default!;
  21. public string HashedName { get; set; } = default!;
  22. public string Path { get; set; } = default!;
  23. public string Url { get; set; } = default!;
  24. public string? Extension { get; set; }
  25. public string? ContentType { get; set; }
  26. public long? Size { get; set; } = 0;
  27. public int Downloads { get; set; } = 0;
  28. public bool IsDisabled { get; set; } = false;
  29. public DateTime? DisabledAt { get; set; }
  30. public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
  31. }