Many to Many Relationship using EF Core
Couple of pointers. You are mixing data notation and fluent mapping.
replace NotMapped attribute with .Ignore fluent mapping.
Also I think its cleaner to move each entity into its own mapping config class using IEntityTypeConfiguration&lt;T&gt;
Dont mix DTO and entities like that. Best practice is to project your entities to DTOs.