Generator Changes at 11/25/2025 2:19:02 AM +03:30

This commit is contained in:
masoodafar-web
2025-11-25 02:21:08 +03:30
parent 358ffc438d
commit 8a7d02ce81
7 changed files with 8 additions and 9 deletions

View File

@@ -1,9 +1,7 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//برچسب محصول
public class PruductTagConfiguration : IEntityTypeConfiguration<PruductTag>
{
@@ -13,18 +11,16 @@ public class PruductTagConfiguration : IEntityTypeConfiguration<PruductTag>
builder.Ignore(entity => entity.DomainEvents);
builder.HasKey(entity => entity.Id);
builder.Property(entity => entity.Id).UseIdentityColumn();
builder
.HasOne(entity => entity.Product)
.WithMany(entity => entity.PruductTags)
.HasForeignKey(entity => entity.ProductId)
.IsRequired(true);
builder
.HasOne(entity => entity.Tag)
.WithMany(entity => entity.PruductTags)
.HasForeignKey(entity => entity.TagId)
.IsRequired(true);
}
}