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

What is the recommended way to do DDD Value Objects in EF Core? #26065

Closed
rantri opened this issue Sep 16, 2021 · 1 comment
Closed

What is the recommended way to do DDD Value Objects in EF Core? #26065

rantri opened this issue Sep 16, 2021 · 1 comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported

Comments

@rantri
Copy link

rantri commented Sep 16, 2021

Hi,

In @JeremyLikness blog post: "The Plan for Entity Framework Core 6.0" there is a section about Domain-Driven Design Value Objects:

image

In EF6 I used Complex Types for value objects. I thought that owned entities is the way to do ValueObjects in EF Core.
Owned entities is the approach recommended in: ".NET microservices - Architecture e-book".

Why owned entities are not a good fit?
What is the recommended way to implement Value Objects?

Thank you all for a great product.

@ajcvickers
Copy link
Member

@rantri See value object examples. Unfortunately, issues to make this better (#9906 and #13947) had to be punted out of 6.0.

Owned types are not a good fit because they have keys, even though the key might be hidden. This results in non-obvious behaviors when value objects are used as if they did not have keys. See this comment and the linked issues for some more discussion.

@ajcvickers ajcvickers added the closed-no-further-action The issue is closed and no further action is planned. label Sep 21, 2021
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-no-further-action The issue is closed and no further action is planned. customer-reported
Projects
None yet
Development

No branches or pull requests

2 participants