Generator Changes at 11/16/2025 12:48:45 AM +03:30
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
using CMSMicroservice.Domain.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
namespace CMSMicroservice.Infrastructure.Persistence.Configurations;
|
||||
//قراردادها
|
||||
public class UserContractConfiguration : IEntityTypeConfiguration<UserContract>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<UserContract> 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.User)
|
||||
.WithMany(entity => entity.UserContracts)
|
||||
.HasForeignKey(entity => entity.UserId)
|
||||
.IsRequired(true);
|
||||
builder
|
||||
.HasOne(entity => entity.Contract)
|
||||
.WithMany(entity => entity.UserContracts)
|
||||
.HasForeignKey(entity => entity.ContractId)
|
||||
.IsRequired(true);
|
||||
builder.Property(entity => entity.SignGuid).IsRequired(true);
|
||||
builder.Property(entity => entity.SignedPdfFile).IsRequired(true);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user