Files
TechHelper/TechHelper.Server/Context/Configuration/KeyPointConfiguration.cs
2025-06-20 15:37:39 +08:00

17 lines
456 B
C#

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