Generator Changes at 11/17/2025 11:53:47 PM +03:30
This commit is contained in:
@@ -41,8 +41,8 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext
|
||||
}
|
||||
public DbSet<UserAddress> UserAddresss => Set<UserAddress>();
|
||||
public DbSet<Package> Packages => Set<Package>();
|
||||
public DbSet<Category> Categories => Set<Category>();
|
||||
public DbSet<Role> Roles => Set<Role>();
|
||||
public DbSet<Category> Categorys => Set<Category>();
|
||||
public DbSet<UserRole> UserRoles => Set<UserRole>();
|
||||
public DbSet<UserWallet> UserWallets => Set<UserWallet>();
|
||||
public DbSet<UserWalletChangeLog> UserWalletChangeLogs => Set<UserWalletChangeLog>();
|
||||
@@ -57,4 +57,5 @@ public class ApplicationDbContext : DbContext, IApplicationDbContext
|
||||
public DbSet<OtpToken> OtpTokens => Set<OtpToken>();
|
||||
public DbSet<Contract> Contracts => Set<Contract>();
|
||||
public DbSet<UserContract> UserContracts => Set<UserContract>();
|
||||
public DbSet<PruductCategory> PruductCategorys => Set<PruductCategory>();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user