I have an entity “Order” which has a many-to-many relationship with another entity “Material”. This relationship is represented by a collection navigation property “Materials” in the Order entity.
I would like to set the “Materials” property to unmodified.
For primitive properties, this can be done using:
entry.Property(e => e.PropertyToKeepUnchanged).IsModified = false;
However, this approach doesn’t work for collection navigation properties. How can I achieve the same effect for the collection properties?