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

Navigation Collection doesn't create/update #1

Open
abdu292 opened this issue Aug 15, 2022 · 2 comments
Open

Navigation Collection doesn't create/update #1

abdu292 opened this issue Aug 15, 2022 · 2 comments

Comments

@abdu292
Copy link

abdu292 commented Aug 15, 2022

Thanks for the blog & the source repo.
I made some changes to your original code that mimic one of my scenarios & it appears that the collection in the navigation property doesn't seem to be considered as part of the Create/Update method.

Repro project here:
EfCoreImmutable.zip

Here I'm expecting the Roles to be created along with the Person object.

Please let me know if I'm missing something or if it needs additional configuration/code changes.

Thanks in advance!

@gravity00 gravity00 pinned this issue Aug 15, 2022
@gravity00
Copy link
Owner

Hi @abdu292

Since I never use navigation properties because the limitations they have, I completely forgot about them. Sincerely, thinking the way of of EF Core works, I'm pretty sure the code as is won't work.

I'll try to give it a look.

@abdu292
Copy link
Author

abdu292 commented Aug 15, 2022

@gravity00 Sure. Let me know if you have something to share.

Also, there is a ticket to support immutability officially (link below, if you don't know already). You may vote this and share with your followers.
dotnet/efcore#11457

Thanks a bunch!

@gravity00 gravity00 unpinned this issue Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants