Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The update process using Automapper fails in EF Core due to the existence of duplicates in many-to-many relationships because EF Core does not support updating many-to-many relationships directly. When Automapper tries to update the relationship, it may end up creating duplicate entries in the join table that maps the relationship. These duplicates can cause errors when trying to save changes to the database.

To avoid this issue, it is recommended to use a separate mapping class for the many-to-many relationship and explicitly handle the creation and deletion of join table entries. Alternatively, you can use Fluent API to configure the many-to-many relationship in EF Core and then use Automapper to update the related entities without touching the join table directly.