CommentImage.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 CommentImage
  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; } = Guid.NewGuid();
  20. public string FileName { get; set; } = default!;
  21. public string HashedName { get; set; } = default!;
  22. public string Path { get; set; } = null!;
  23. public string Url { get; set; } = null!;
  24. public string? Extension { get; set; }
  25. public string? ContentType { get; set; }
  26. public long? Size { get; set; }
  27. public short? Width { get; set; }
  28. public short? Height { get; set; }
  29. public bool IsDisabled { get; set; } = false;
  30. public DateTime? DisabledAt { get; set; }
  31. public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
  32. }