You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
The text was updated successfully, but these errors were encountered: