I\'ve been trying to create navigation properties for my collection types and I found this example of how one person accomplished it using OnModelCreating. I gave it a try i
You might have to add something like the following to OnModelCreating
modelBuilder.Entity().HasKey(l => l.UserId);
modelBuilder.Entity().HasKey(r => r.Id);
modelBuilder.Entity().HasKey(r => new { r.RoleId, r.UserId });
See also: