using Core.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Data.Configurations { public class TeamMeetingHistoryConfiguration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.HasKey(tmh => tmh.Id); // Indexes builder.HasIndex(tmh => tmh.MeetingDate); // Constraints builder.Property(tmh => tmh.MeetingDate) .IsRequired(); builder.HasMany(tmh => tmh.Teams) .WithMany() .UsingEntity(j => j.ToTable("TeamMeetingHistoryTeams")); builder.HasMany(tmh => tmh.Students) .WithMany() .UsingEntity(j => j.ToTable("TeamMeetingHistoryStudents")); } } }