示例#1
0
 public static void Setup(EntityTypeBuilder <Board> entity)
 {
     SetupEntity.Setup(entity);
     entity.Property(e => e.BoardName).IsRequired();
     entity.Property(e => e.BoardKey).IsRequired();
     entity.HasIndex(e => e.BoardKey).IsUnique();
 }
示例#2
0
 public static void Setup(EntityTypeBuilder <AnalyticsReport> entity)
 {
     SetupEntity.Setup(entity);
     entity.Property(e => e.Location).IsRequired();
     entity.Property(e => e.ThumbPrint).IsRequired();
     entity.Property(e => e.Time).IsRequired();
 }
示例#3
0
 public static void Setup(EntityTypeBuilder <File> entity)
 {
     SetupEntity.Setup(entity);
     entity.Property(e => e.Data).IsRequired();
     entity.Property(e => e.FileName).IsRequired();
     entity.Property(e => e.MimeType).IsRequired();
     entity.Property(e => e.ThumbNailJpeg).IsRequired();
     entity.HasOne(a => a.Post).WithOne(a => a.File).HasForeignKey <File>(a => a.Id);
 }
示例#4
0
 public static void Setup(EntityTypeBuilder <Post> entity)
 {
     SetupEntity.Setup(entity);
     entity.Property(e => e.Comment).IsRequired();
     entity.Property(e => e.Name).IsRequired();
     entity.Property(e => e.IpAddress).IsRequired();
     entity.Property(e => e.ThreadId).IsRequired();
     ////entity.Property(e => e.File).SetupAsCharGuid();
 }
示例#5
0
 public static void Setup(EntityTypeBuilder <Thread> entity)
 {
     SetupEntity.Setup(entity);
     entity.Property(e => e.Subject).IsRequired();
     entity.Property(e => e.BoardId).IsRequired();
 }
示例#6
0
 public static void Setup(EntityTypeBuilder <BannedImage> entity)
 {
     SetupEntity.Setup(entity);
     entity.Property(e => e.Reason).IsRequired();
     entity.Property(e => e.Hash).IsRequired();
 }