Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@joewashington75
Created March 25, 2020 20:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joewashington75/60759a019c9dbe3523f07953d08ab2b4 to your computer and use it in GitHub Desktop.
Save joewashington75/60759a019c9dbe3523f07953d08ab2b4 to your computer and use it in GitHub Desktop.
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