nhibernate / nhibernate-core

NHibernate Object Relational Mapper
https://nhibernate.info
GNU Lesser General Public License v2.1
2.13k stars 925 forks source link

Nhibernate preserves duplication for a many-to-many table after mapping from the UI #3564

Closed IhorSysak closed 3 months ago

IhorSysak commented 3 months ago

I have a table with many-to-many relationships. Let's call it 'UserRole' which means it's a table that stores the relationship of users to roles. For some reason, I need to manipulate this data in the UI, so I created a view model and a simple mapper for it, where I configure the data from the entity to the view model and vice versa. After making some adjustments to the table in the UI, I save my changes. And as a result, I have a saved duplication of data.

gliljas commented 3 months ago

We need more information than this to deduce if it's really an issue. Can you reproduce the problem in a test?