using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace DataLayer.Configurations { internal class ContributorConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder entity) { entity.HasKey(c => c.ContributorId); entity.HasIndex(c => c.Name); //entity.OwnsOne(b => b.AuthorProperty); // ... in separate table entity .Metadata .FindNavigation(nameof(Contributor.BooksLink)) .SetPropertyAccessMode(PropertyAccessMode.Field); } } }