Skip to content
New issue

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

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

Already on GitHub? # to your account

Entity Framework owned entities not saving #105

Closed
roly445 opened this issue Nov 12, 2023 · 7 comments
Closed

Entity Framework owned entities not saving #105

roly445 opened this issue Nov 12, 2023 · 7 comments
Assignees

Comments

@roly445
Copy link

roly445 commented Nov 12, 2023

Hi, I have just started looking into using this framework to accelerate my development around DDD.

I am currently using EF core and owned entities and I'm having issues with the persistence on these types.

I have used Rider to debug into the assembly as it's running and found that if I force the skipping the method PrepareItem in EntityFrameworkCoreRepository it works as expected.

Do you have any guidance on this?

Many thanks

@mgernand
Copy link
Contributor

Hi, thanks for bringing this to our attention. Can you post your repository and EF Core configuration? Or do you have an example app that we can look at?

@roly445
Copy link
Author

roly445 commented Nov 12, 2023

I have something; just let me get it in a reasonable state and I'll send you a link to the repository.

@mgernand mgernand self-assigned this Nov 12, 2023
@roly445
Copy link
Author

roly445 commented Nov 12, 2023

I have just tidied up the solution and uploaded it here https://github.com/roly445/spamma. Hopefully it makes sense.

@roly445
Copy link
Author

roly445 commented Dec 31, 2023

Would you accept a PR for this?

@mgernand
Copy link
Contributor

mgernand commented Dec 31, 2023

Would you accept a PR for this?

Yes, absolutely. Please include tests that reproduce the problem.

@mgernand mgernand changed the title Entity Framework owned entities not not saving Entity Framework owned entities not saving Dec 31, 2023
@roly445
Copy link
Author

roly445 commented Dec 31, 2023

Thanks, I will do. Just so I know, what was the rationale behind modifying the entity's state?

I only ask because if I remove the calls to PrepareItem from the AddAsync and AddRangeAsync methods all the unit tests still pass

@mgernand
Copy link
Contributor

mgernand commented Jan 1, 2024

Just so I know, what was the rationale behind modifying the entity's state?

To be honest, I don't know anymore why I did that. 🙈

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants