EntityFramework.Docs
EntityFramework.Docs copied to clipboard
Faulty code example for storing owned types in separate tables
The code example for storing owned types in separate tables has to be:
modelBuilder.Entity<Order>().OwnsOne(p => p.OrderDetails, od =>
{
od.OwnsOne(c => c.BillingAddress);
od.OwnsOne(c => c.ShippingAddress);
od.ToTable("OrderDetails");
});
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: d02e6748-42e0-000a-4945-42cd05a0b875
- Version Independent ID: e3effbd0-07f2-423d-4032-1722e75adb37
- Content: Owned Entity Types - EF Core
- Content Source: entity-framework/core/modeling/owned-entities.md
- Product: entity-framework
- GitHub Login: @julielerman
- Microsoft Alias: divega
@GeroIwan Thanks.