using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore; namespace DataLayer.Configurations { internal class CategoryLadderConfig : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder entity) { entity.HasKey(cl => cl.CategoryLadderId); entity.Ignore(cl => cl.Categories); entity .HasMany(cl => cl._categories) .WithMany(c => c._categoryLadders); entity .Metadata .FindNavigation(nameof(CategoryLadder.BooksLink)) .SetPropertyAccessMode(PropertyAccessMode.Field); } } }