Generator Changes at 11/25/2025 2:19:02 AM +03:30
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user