Loading...
Loading...
Compare original and translation side by side
src/Infrastructure/EntityFramework/Repositories/DbContextsrc/Infrastructure/EntityFramework/Repositories/DbContextCipherRepository.GetManyByUserId()[DatabaseData]CipherRepository.GetManyByUserId()[DatabaseData]Min()[DatabaseData]Min()[DatabaseData]pwsh ef_migrate.ps1 <MigrationName>pwsh ef_migrate.ps1 <MigrationName>YYYY-MM-DD_##_MigrationName.sqlYYYY-MM-DD_##_MigrationName.sqlCipherOrganizationUserUp()Down()CipherOrganizationUserUp()Down()public virtual Organization Organization { get; set; }public virtual Organization Organization { get; set; }EntityTypeConfigurationEntityTypeConfigurationOnModelCreatingOnModelCreatingCoreHelpers.GenerateComb()ValueGeneratedOnAdd()CoreHelpers.GenerateComb()ValueGeneratedOnAdd()EntityTypeConfiguration<T>OnModelCreatingYYYY-MM-DD_##_MigrationName.sqlpwsh ef_migrate.ps1 <Name>Up()Down()ValueGeneratedOnAdd()CoreHelpers.GenerateComb()EntityTypeConfiguration<T>OnModelCreatingYYYY-MM-DD_##_MigrationName.sqlpwsh ef_migrate.ps1 <Name>Up()Down()ValueGeneratedOnAdd()CoreHelpers.GenerateComb()// CORRECT — ID generated in application code
public void Configure(EntityTypeBuilder<Cipher> builder)
{
builder.HasKey(c => c.Id);
// No ValueGeneratedOnAdd — CoreHelpers.GenerateComb() handles this
}
// WRONG — lets database generate IDs, breaks MSSQL parity
public void Configure(EntityTypeBuilder<Cipher> builder)
{
builder.HasKey(c => c.Id);
builder.Property(c => c.Id).ValueGeneratedOnAdd();
}// CORRECT — ID generated in application code
public void Configure(EntityTypeBuilder<Cipher> builder)
{
builder.HasKey(c => c.Id);
// No ValueGeneratedOnAdd — CoreHelpers.GenerateComb() handles this
}
// WRONG — lets database generate IDs, breaks MSSQL parity
public void Configure(EntityTypeBuilder<Cipher> builder)
{
builder.HasKey(c => c.Id);
builder.Property(c => c.Id).ValueGeneratedOnAdd();
}// CORRECT — only add when the SP also joins this table
public class Cipher
{
public Guid Id { get; set; }
public Guid OrganizationId { get; set; }
// No navigation property — the SP doesn't JOIN Organization
}
// WRONG — causes N+1 queries that don't match SP behavior
public class Cipher
{
public Guid Id { get; set; }
public Guid OrganizationId { get; set; }
public virtual Organization Organization { get; set; }
}// CORRECT — only add when the SP also joins this table
public class Cipher
{
public Guid Id { get; set; }
public Guid OrganizationId { get; set; }
// No navigation property — the SP doesn't JOIN Organization
}
// WRONG — causes N+1 queries that don't match SP behavior
public class Cipher
{
public Guid Id { get; set; }
public Guid OrganizationId { get; set; }
public virtual Organization Organization { get; set; }
}