Generator Changes at 11/17/2025 11:53:47 PM +03:30

This commit is contained in:
masoodafar-web
2025-11-17 23:57:51 +03:30
parent da07a3da38
commit dba8aecc97
50 changed files with 978 additions and 19 deletions
@@ -0,0 +1,26 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//دسته بندی
public class PruductCategoryConfiguration : IEntityTypeConfiguration<PruductCategory>
{
public void Configure(EntityTypeBuilder<PruductCategory> 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.ProductPruductCategorys)
.HasForeignKey(entity => entity.ProductId)
.IsRequired(true);
builder
.HasOne(entity => entity.Category)
.WithMany(entity => entity.PruductCategorys)
.HasForeignKey(entity => entity.CategoryId)
.IsRequired(true);
}
}
@@ -1,9 +1,8 @@
using CMSMicroservice.Domain.Entities;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
//کاربر
public class UserConfiguration : IEntityTypeConfiguration<User>
{
public void Configure(EntityTypeBuilder<User> builder)
@@ -31,5 +30,7 @@ public class UserConfiguration : IEntityTypeConfiguration<User>
builder.Property(entity => entity.SmsNotifications).IsRequired(true);
builder.Property(entity => entity.PushNotifications).IsRequired(true);
builder.Property(entity => entity.BirthDate).IsRequired(false);
builder.Property(entity => entity.HashPassword).IsRequired(false);
}
}
}