using Db.Models; using Microsoft.EntityFrameworkCore; public class AdapterContext : DbContext { public AdapterContext(DbContextOptions options) : base(options) { } protected override void OnModelCreating(ModelBuilder modelBuilder) { // Configure your entity mappings here base.OnModelCreating(modelBuilder); modelBuilder.Entity(e => { e.HasKey(vt => new { vt.VideoId, vt.TagId }); e.HasOne(vt => vt.Video) .WithMany(v => v.VideoTags) .HasForeignKey(vt => vt.VideoId); e.HasOne(vt => vt.Tag) .WithMany(t => t.VideoTags) .HasForeignKey(vt => vt.TagId); }); modelBuilder.Entity