/
afanasevn
/
MaxSystems
Обзор
Документация
Войти
/
afanasevn
/
MaxSystems
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/MaxSystems.Infrastructure/Data/Configurations/ChecklistResponseConfiguration.cs
24 строки
850 B
IBS\NAfanasev
Add project files.
18 июн 2026, 01:12
18 июн 2026, 01:12
b06aa39
Код
Авторство
О чём код?
using MaxSystems.Domain.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace MaxSystems.Infrastructure.Data.Configurations; public class ChecklistResponseConfiguration : IEntityTypeConfiguration<ChecklistResponse> { public void Configure(EntityTypeBuilder<ChecklistResponse> builder) { builder.ToTable("checklist_responses"); builder.HasKey(x => x.Id); builder.Property(x => x.Type).HasMaxLength(64).IsRequired(); builder.Property(x => x.ItemsJson).HasColumnType("jsonb").IsRequired(); builder.Property(x => x.SummaryJson).HasColumnType("jsonb"); builder.HasOne(x => x.Work) .WithOne(x => x.Checklist) .HasForeignKey<ChecklistResponse>(x => x.WorkId) .OnDelete(DeleteBehavior.Cascade); } }