BoardGroup.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using Microsoft.EntityFrameworkCore;
  2. using System.ComponentModel;
  3. using System.ComponentModel.DataAnnotations;
  4. using System.ComponentModel.DataAnnotations.Schema;
  5. namespace bitforum.Models.BBS
  6. {
  7. [Table("BoardGroup")]
  8. [Index(nameof(Code), Name = "IX_BoardGroup_Code")]
  9. [Index(nameof(Name), Name = "IX_BoardGroup_Name")]
  10. [Index(nameof(Order), Name = "IX_BoardGroup_Order")]
  11. [Index(nameof(Boards), Name = "IX_BoardGroup_Boards")]
  12. [Index(nameof(Posts), Name = "IX_BoardGroup_Posts")]
  13. [Index(nameof(Comments), Name = "IX_BoardGroup_Comments")]
  14. public class BoardGroup
  15. {
  16. public virtual ICollection<Board> Board { get; set; } = new List<Board>();
  17. [Key]
  18. [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
  19. [DisplayName("PK")]
  20. [Comment("PK")]
  21. public int ID { get; set; }
  22. [Required]
  23. [DisplayName("게시판 분류 주소")]
  24. [Comment("게시판 분류 주소")]
  25. [DataType(DataType.Text)]
  26. [StringLength(70)]
  27. public string Code { get; set; } = null!;
  28. [Required]
  29. [DisplayName("게시판 분류 명")]
  30. [Comment("게시판 분류 명")]
  31. [DataType(DataType.Text)]
  32. [StringLength(70)]
  33. public string Name { get; set; } = null!;
  34. [Required]
  35. [DisplayName("순서")]
  36. [Comment("순서")]
  37. public short Order { get; set; } = 0;
  38. [DisplayName("게시판 수")]
  39. [Comment("게시판 수")]
  40. public ushort Boards { get; set; } = 0;
  41. [DisplayName("게시글 수")]
  42. [Comment("게시글 수")]
  43. public uint Posts { get; set; } = 0;
  44. [DisplayName("댓글 수")]
  45. [Comment("댓글 수")]
  46. public uint Comments { get; set; } = 0;
  47. [DisplayName("수정 일시")]
  48. [Comment("수정 일시")]
  49. [DataType(DataType.DateTime)]
  50. public DateTime? UpdatedAt { get; set; } = null;
  51. [DisplayName("등록 일시")]
  52. [Comment("등록 일시")]
  53. [DataType(DataType.DateTime)]
  54. public DateTime CreatedAt { get; set; }
  55. }
  56. }