Files
Backend-Api/CompanyManagment.EFCore/Mapping/ChapterMaspping.cs
2024-07-05 21:36:15 +03:30

19 lines
616 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Company.Domain.ChapterAgg;
namespace CompanyManagment.EFCore.Mapping;
public class ChapterMaspping : IEntityTypeConfiguration<EntityChapter>
{
public void Configure(EntityTypeBuilder<EntityChapter> builder)
{
builder.ToTable("TextManager_Chapter");
builder.HasKey(x => x.id);
builder.Property(x => x.Chapter).HasMaxLength(60).IsRequired();
builder.HasOne(x => x.EntitySubtitle)
.WithMany(x => x.Chapters)
.HasForeignKey(x => x.Subtitle_Id);
}
}