I'm trying to create a many-to-many mapping with a junction table where I don't model the associative entity. Here is some code:
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
builder.HasMany(p => p.Roles).WithMany().Map(m =>
{
m.ToTable("WorkflowStateRoles");
m.MapLeftKey("WorkflowStateId");
m.MapRightKey("RoleId");
});
WithMany() is no where to be found. What namespace do I need to include?
Currently in EF Core many-to-many associates require the junction table to be mapped. See #1368
@ajcvickers Thanks for your reply. That's awful, though. Please prioritize as having to create entities, configurations, etc. isn't great and accessing the data through an extra layer is more nasty.
Most helpful comment
@ajcvickers Thanks for your reply. That's awful, though. Please prioritize as having to create entities, configurations, etc. isn't great and accessing the data through an extra layer is more nasty.