Seeding Many-To-Many data
问题 Hello I'm trying to create some seeds for my project, but I'm having trouble seeding the Many-To-Many relationship data to the db. My database looks like this: in TeacherSkills , Teacher_ID and Skill_ID are foreign keys for their tables ofcourse. My seeder looks like this protected override void Seed(Ability_Examen_ASP.Models.AbilityDbContext context) { if (!context.Skills.Any()) { context.Skills.Add(new Models.Skill { SkillName = "PHP" }); context.Skills.Add(new Models.Skill { SkillName =