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);
}
	}
}