MapLeftKey
and MapRightKey
have a params string[] keyColumnNames
parameter, so for composite keys you pass in multiple parameters into those methods instead of calling them twice:
modelBuilder.Entity<SegRol>()
.HasMany(i => i.Functions)
.WithMany(c => c.Roles)
.Map(m =>
{
mc.ToTable("seg_role_function");
m.MapLeftKey("id_role");
m.MapRightKey("id_aplication", "id_function");
});