ChatRoomConfigConfiguration.cs 971 B

12345678910111213141516171819
  1. using Domain.Entities.Chat;
  2. using Microsoft.EntityFrameworkCore;
  3. using Microsoft.EntityFrameworkCore.Metadata.Builders;
  4. namespace Infrastructure.Persistence.Configurations.Chat;
  5. public sealed class ChatRoomConfigConfiguration : IEntityTypeConfiguration<ChatRoomConfig>
  6. {
  7. public void Configure(EntityTypeBuilder<ChatRoomConfig> builder)
  8. {
  9. builder.ToTable(nameof(ChatRoomConfig), t => t.HasComment("채팅방 설정 (main | stock:{code})"));
  10. builder.HasKey(x => x.RoomKey);
  11. builder.Property(x => x.RoomKey).HasMaxLength(20).IsRequired().HasComment("룸 키");
  12. builder.Property(x => x.IsActive).IsRequired().HasComment("활성 여부 (종목방 단계 오픈 게이트)");
  13. builder.Property(x => x.SlowModeSeconds).IsRequired().HasComment("슬로우 모드 (초)");
  14. builder.Property(x => x.Notice).HasMaxLength(200).HasComment("상단 고정 공지");
  15. builder.Property(x => x.UpdatedAt).IsRequired();
  16. }
  17. }