using Entities.Contracts; using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; namespace TechHelper.Context.Configuration { public class KeyPointConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasOne(kp=>kp.Lesson) .WithMany(l => l.KeyPoints) .HasForeignKey(kp => kp.LessonID) .OnDelete(DeleteBehavior.Cascade); } } }