using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace DataLayer.Configurations { internal class LibraryBookConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder entity) { entity.HasKey(b => b.BookId); entity .HasOne(le => le.Book) .WithOne() .HasForeignKey(le => le.BookId); } } }