Created
March 25, 2020 20:37
-
-
Save joewashington75/60759a019c9dbe3523f07953d08ab2b4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using EFCoreSeparateProject.Core.Domain; | |
using Microsoft.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore.Metadata.Builders; | |
namespace EFCoreSeparateProject.Infrastructure.EntityConfigurations | |
{ | |
public class PersonConfiguration : IEntityTypeConfiguration<Person> | |
{ | |
public void Configure(EntityTypeBuilder<Person> builder) | |
{ | |
builder.OwnsOne(e => e.Address, t => | |
{ | |
//t.OwnsOne(a => a.Line1).Property(e => e.Line).HasColumnName("AddressLine1"); | |
t.OwnsOne(a => a.Line1); | |
t.OwnsOne(a => a.Line2); | |
t.OwnsOne(a => a.Postcode); | |
}); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment