Complete TaskSectionRevisionMapping.cs

This commit is contained in:
2026-01-21 19:21:26 +03:30
parent 36ccd96352
commit 025c59e695

View File

@@ -1,3 +1,4 @@
using GozareshgirProgramManager.Domain.FileManagementAgg.Entities;
using GozareshgirProgramManager.Domain.ProjectAgg.Entities.Task.TaskSection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
@@ -16,10 +17,17 @@ public class TaskSectionRevisionMapping:IEntityTypeConfiguration<TaskSectionRevi
builder.Property(x => x.Status).HasConversion<string>();
builder.Property(x => x.Message).HasMaxLength(500);
builder.OwnsMany(x=>x.Files, file =>
builder.OwnsMany(x => x.Files, file =>
{
})
file.HasKey(x => x.Id);
file.Property(x => x.Id).ValueGeneratedNever();
file.HasOne<UploadedFile>()
.WithMany()
.HasForeignKey(x => x.FileId)
.IsRequired()
.OnDelete(DeleteBehavior.Restrict);
});
}
}