Generator Changes at 11/12/2025 1:32:03 AM +03:30
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//آدرس کاربر
|
||||
public class FactorDetailsConfiguration : IEntityTypeConfiguration<FactorDetails>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<FactorDetails> builder)
|
||||
{
|
||||
builder.HasQueryFilter(p => !p.IsDeleted);
|
||||
builder.Ignore(entity => entity.DomainEvents);
|
||||
builder.HasKey(entity => entity.Id);
|
||||
builder.Property(entity => entity.Id).UseIdentityColumn();
|
||||
builder
|
||||
.HasOne(entity => entity.Product)
|
||||
.WithMany(entity => entity.ProductFactorDetailss)
|
||||
.HasForeignKey(entity => entity.ProductId)
|
||||
.IsRequired(true);
|
||||
builder.Property(entity => entity.Count).IsRequired(true);
|
||||
builder.Property(entity => entity.UnitPrice).IsRequired(true);
|
||||
builder.Property(entity => entity.UnitDiscount).IsRequired(true);
|
||||
builder
|
||||
.HasOne(entity => entity.Order)
|
||||
.WithMany(entity => entity.OrderFactorDetailss)
|
||||
.HasForeignKey(entity => entity.OrderId)
|
||||
.IsRequired(true);
|
||||
builder.Property(entity => entity.UnitDiscountPrice).IsRequired(true);
|
||||
builder.Property(entity => entity.IsChangePrice).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user