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

FEATURE: Change implementation of ValueObject to ComplexTypes #81

Open
CesarD opened this issue Aug 7, 2024 · 0 comments
Open

FEATURE: Change implementation of ValueObject to ComplexTypes #81

CesarD opened this issue Aug 7, 2024 · 0 comments
Labels
blocked enhancement New feature or request

Comments

@CesarD
Copy link
Collaborator

CesarD commented Aug 7, 2024

Detailed Description

Change the implementation of ValueObject to leverage EF Core 8's ComplexTypes and Records.

Context

With the release of EF Core 8, ComplexTypes have been introduced which help leverage ValueObjects much better and properly than with the current implementation: https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/whatsnew#value-objects-using-complex-types.
ComplexTypes allow to handle the ValueObjects without masking an entity behind scenes so one can handle the same instance and assign it to multiple entities without DbContext to break do to multiple entity being tracked multiple times. Also, it allows to work with Records, which are a much better type to work with for ValueObjects without having to resort to a class overriding its base methods.

Possible Implementation

Switching ValueObject class by implementing Records and replacing OwnsOne by ComplexProperty in the parent entities.

Implementation blocked by issue: dotnet/efcore#31245

@CesarD CesarD added enhancement New feature or request blocked labels Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant