From bbbcc06e48e2e375479914691171479e2b7ca053 Mon Sep 17 00:00:00 2001 From: colin Date: Wed, 9 Oct 2024 15:06:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(data-protection):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BF=9D=E6=8A=A4=E8=A7=84=E5=88=99=E5=AE=9E?= =?UTF-8?q?=E4=BD=93=E5=85=B3=E7=B3=BB=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EntityFrameworkCore/AbpDataProtectionDbContext.cs | 3 +-- .../DataProtectionManagementApplicationMappingProfile.cs | 4 ++++ .../AbpDataProtectionManagementDomainModule.cs | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs index 09b24b506..5f792f1ee 100644 --- a/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs +++ b/aspnet-core/framework/data-protection/LINGYUN.Abp.DataProtection.EntityFrameworkCore/LINGYUN/Abp/DataProtection/EntityFrameworkCore/AbpDataProtectionDbContext.cs @@ -16,8 +16,7 @@ public abstract class AbpDataProtectionDbContext : AbpDbContext DataProtectionOptions => LazyServiceProvider.LazyGetRequiredService>(); public ICurrentUser CurrentUser => LazyServiceProvider.LazyGetRequiredService(); - public AbpDataProtectionDbContext( - DbContextOptions options) : base(options) + protected AbpDataProtectionDbContext(DbContextOptions options) : base(options) { } diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs index 0141a1461..84efe897e 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Application/LINGYUN/Abp/DataProtectionManagement/DataProtectionManagementApplicationMappingProfile.cs @@ -10,6 +10,10 @@ public class DataProtectionManagementApplicationMappingProfile :Profile CreateMap() .ForMember(dto => dto.ValueRange, map => map.MapFrom(src => MapToArray(src.ValueRange))); CreateMap(); + CreateMap() + .ForMember(dto => dto.AllowProperties, map => map.MapFrom(src => MapToArray(src.AllowProperties))); + CreateMap() + .ForMember(dto => dto.AllowProperties, map => map.MapFrom(src => MapToArray(src.AllowProperties))); } private string[] MapToArray(string val) diff --git a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs index 1e4967ce1..3691baad5 100644 --- a/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs +++ b/aspnet-core/modules/data-protection/LINGYUN.Abp.DataProtectionManagement.Domain/LINGYUN/Abp/DataProtectionManagement/AbpDataProtectionManagementDomainModule.cs @@ -1,6 +1,8 @@ using LINGYUN.Abp.DataProtection; +using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; +using Volo.Abp.Caching; using Volo.Abp.Domain; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Modularity; @@ -35,6 +37,11 @@ public class AbpDataProtectionManagementDomainModule : AbpModule options.AutoEventSelectors.Add(); }); + Configure(options => + { + options.ConfigureCache(new DistributedCacheEntryOptions()); + }); + context.Services.AddHostedService(); } }