EFDesigner2022
EFDesigner2022 copied to clipboard
Update nested Entities not working
My code for update is following:
Using _DbContext As New FxCorePrints(DbOptionBuilder.Options)
_DbContext.Entry(serverPrintGroup).CurrentValues.SetValues(PrintGroupEntity)
_DbContext.Update(serverPrintGroup)
_DbContext.SaveChanges()
NLOGLOGGER.Debug("PrintGroup is successfull modiefied in database")
End Using
But when i have a new nested entity in PrintGroupEntity
, then only the first level of properties will be modified - but not the added subentity
I have a Many:Many Join between Print
and PrintGroup
Could you post a small project showing the problem? I'd be happy to look at it.
Here is a MSTest-Project to show the problem. When I create a nested Entity the Parent and child will be create fine.
If i modify the Childs and will save it, then they didnt work
Can you give a hint for that how can i solve this on a common way. I hope it can be recursiv and automatic find all properties that be a collection.