Files
Backend-Api/AccountMangement.Infrastructure.EFCore/Mappings/AdminResponseMapping.cs
2024-08-24 19:13:34 +03:30

23 lines
801 B
C#

using AccountManagement.Domain.AdminResponseAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class AdminResponseMapping : IEntityTypeConfiguration<AdminResponse>
{
public void Configure(EntityTypeBuilder<AdminResponse> builder)
{
builder.ToTable("AdminResponses");
builder.HasKey(x => x.id);
builder.Property(x => x.Response).HasColumnType("ntext");
builder.Property(x => x.IsActiveString).HasMaxLength(5);
builder.HasMany(x => x.AdminResponseMedias).WithOne(x => x.AdminResponse).HasForeignKey(x => x.AdminResponseId);
builder.HasOne(x => x.Ticket).WithMany(x => x.AdminResponses).HasForeignKey(x => x.TicketId);
}
}