struct&&assiQues
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user