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

18 lines
604 B
C#

using Company.Domain.FileAlert;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CompanyManagment.EFCore.Mapping;
public class FileAlertMapping : IEntityTypeConfiguration<FileAlert>
{
public void Configure(EntityTypeBuilder<FileAlert> builder)
{
builder.ToTable("File_Alerts");
builder.HasKey(x => x.id);
builder.HasOne(x => x.File).WithMany(x => x.FileAlertsList).HasForeignKey(x => x.File_Id);
builder.HasOne(x => x.FileState).WithMany(x => x.FileAlertsList).HasForeignKey(x => x.FileState_Id);
}
}