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

EF Core: Owned types support #500

Merged
merged 19 commits into from
Jun 5, 2024

Conversation

Daniel-Svensson
Copy link
Member

@Daniel-Svensson Daniel-Svensson commented Apr 23, 2024

  • Initial support for Owned Entities for one-to-one navigation properties (EF Core: Owned types support #500)
    • Owned entities without explicit keys are mapped to OpenRiaServices's [Complex Types]
    • Owned entities with explicit keys are generated as normal "Entities" but are automatically annotated with [Composition]
    • EFCore "Complex Types" introduced in EFCore 8.0 does not have any special handling, but works
  • Add package README to OpenRiaServices.Server.EntityFrameworkCore

@Daniel-Svensson Daniel-Svensson marked this pull request as ready for review April 24, 2024 19:27
@Daniel-Svensson
Copy link
Member Author

Note: It would probably be a good idea to write a line or two to the package readme about using DbService, Owned Types (and Complex Types).

Complex types works reasonable "well", they are discovered as "complex object" but do not get any metadata from EF Core configuration.
If you add attributes to the properties they will be discovered by reflection @SandstromErik

@Daniel-Svensson
Copy link
Member Author

Things left to consider.

  • If we don't add OwnedEntities as ComplexObjects we should probably infer [Composition] on them.

    • @erikoijwall I know you did a workaround with owned entities using the previous efcore release, do you have any thoughts
  • Should we do something to "discourage" efcore "complex objects" since each usage are mapped to a "virtual type/class" so it can have different metada for each usage.

  • We should add some more documentation ..

@Daniel-Svensson Daniel-Svensson enabled auto-merge (squash) June 5, 2024 09:44
Copy link

sonarqubecloud bot commented Jun 5, 2024

@Daniel-Svensson Daniel-Svensson merged commit 34d62dd into OpenRIAServices:main Jun 5, 2024
4 of 5 checks passed
@Daniel-Svensson Daniel-Svensson deleted the owned_types branch June 5, 2024 10:05
@Daniel-Svensson Daniel-Svensson added this to the 5.5.0 milestone Jun 11, 2024
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

Successfully merging this pull request may close these issues.

2 participants