Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nested Entities not working #89

Open
MyKeySoftMK opened this issue Jan 4, 2024 · 2 comments
Open

Update nested Entities not working #89

MyKeySoftMK opened this issue Jan 4, 2024 · 2 comments
Labels
question Requesting information

Comments

@MyKeySoftMK
Copy link

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

@msawczyn
Copy link
Owner

Could you post a small project showing the problem? I'd be happy to look at it.

@msawczyn msawczyn added the question Requesting information label Jan 16, 2024
@MyKeySoftMK
Copy link
Author

MyKeySoftMK commented Apr 6, 2024

EFDesigner2022Tests.zip

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Requesting information
Projects
Status: Enhancement Requests
Development

No branches or pull requests

2 participants