mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-03-25 02:13:27 -04:00
Make fields readonly Remove unnecessary casts Format document Remove unnecessary usings Sort usings Use file-level namespaces Order modifiers
24 lines
583 B
C#
24 lines
583 B
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
|
|
|
namespace DataLayer.Configurations;
|
|
|
|
internal class CategoryLadderConfig : IEntityTypeConfiguration<CategoryLadder>
|
|
{
|
|
public void Configure(EntityTypeBuilder<CategoryLadder> 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);
|
|
}
|
|
}
|