© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•13mo ago•
170 replies
y4hira

Updating/Deleting owned properties with EF Core and AutoMapper

The problem I'm facing is that automapper is not tracking the changes since when i retrive AsNotracking() it wont change anything, but if i remove that, then it complains about the same entity being tracked when i do
mapper.map<Entity>(doman), which creates a new entity and EF begins tracking it, I solved it by fetching the entity in the repository and doing mapper.map(entity, domain) so it replaces the one i fetched, but in my command handler I already did the fetch of the entity and did an in place mapping to change its values, how can I avoid re fetching in my repository?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

Calculated Properties with EF Core
C#CC# / help
2y ago
✅ EF Core navigational properties
C#CC# / help
3y ago
❔ Using automapper to update EF Core entities recursively
C#CC# / help
3y ago
❔ EF Core: Owned property with converter expression cannot be converted
C#CC# / help
3y ago