Files
Backend-Api/AccountMangement.Infrastructure.EFCore/Mappings/ClientResponseMapping.cs
2024-07-10 20:25:54 +03:30

20 lines
741 B
C#

using AccountManagement.Domain.ClientResponseAgg;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace AccountMangement.Infrastructure.EFCore.Mappings;
public class ClientResponseMapping:IEntityTypeConfiguration<ClientResponse>
{
public void Configure(EntityTypeBuilder<ClientResponse> builder)
{
builder.ToTable("ClientResponses");
builder.HasKey(x => x.id);
builder.Property(x => x.Response).HasColumnType("ntext");
builder.HasMany(x => x.ClientResponseMedias).WithOne(x => x.ClientResponse).HasForeignKey(x => x.ClientResponseId);
builder.HasOne(x => x.Ticket).WithMany(x => x.ClientResponses).HasForeignKey(x => x.TicketId);
}
}