Browse Source

Merge pull request #1015 from colinin/fix-migrations-dbcontext

fix(migrations): 修复迁移时DI容器不可用(#1011)
pull/1050/head
yx lin 1 year ago
committed by GitHub
parent
commit
639e59298c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs

11
aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs

@ -24,10 +24,13 @@ public abstract class AbpDataProtectionDbContext<TDbContext> : AbpDbContext<TDbC
{
base.OnConfiguring(optionsBuilder);
// TODO: 需要优化表达式树
// optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService<AbpDataProtectedReadEntityInterceptor>());
//optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService<AbpDataProtectedWriteEntityInterceptor>());
optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService<AbpDataProtectedWritePropertiesInterceptor>());
if (LazyServiceProvider != null)
{
// TODO: 需要优化表达式树
// optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService<AbpDataProtectedReadEntityInterceptor>());
//optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService<AbpDataProtectedWriteEntityInterceptor>());
optionsBuilder.AddInterceptors(LazyServiceProvider.GetRequiredService<AbpDataProtectedWritePropertiesInterceptor>());
}
}
protected override void ApplyAbpConceptsForAddedEntity(EntityEntry entry)

Loading…
Cancel
Save