From 17bc4601561799fe2b5e9ba59910be68754426f6 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Tue, 19 Aug 2025 11:05:42 +0300 Subject: [PATCH 1/6] Convert mappers to mapperly for TenantManagement --- ...tManagementApplicationAutoMapperProfile.cs | 12 --- ...antManagementApplicationMapperlyMappers.cs | 33 +++++++ .../AbpTenantManagementApplicationModule.cs | 7 +- ...TenantManagementBlazorAutoMapperProfile.cs | 12 --- ...bpTenantManagementBlazorMapperlyMappers.cs | 15 ++++ .../AbpTenantManagementBlazorModule.cs | 11 +-- .../Volo.Abp.TenantManagement.Blazor.csproj | 2 +- .../Volo.Abp.TenantManagement.Domain.csproj | 2 +- ...bpTenantManagementDomainMapperlyMappers.cs | 89 +++++++++++++++++++ ...AbpTenantManagementDomainMappingProfile.cs | 44 ++++----- .../AbpTenantManagementDomainModule.cs | 11 +-- ...AbpTenantManagementWebAutoMapperProfile.cs | 22 ----- .../AbpTenantManagementWebMapperlyMappers.cs | 50 +++++++++++ .../AbpTenantManagementWebModule.cs | 10 +-- .../Volo.Abp.TenantManagement.Web.csproj | 2 +- 15 files changed, 222 insertions(+), 100 deletions(-) delete mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationAutoMapperProfile.cs create mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs delete mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorAutoMapperProfile.cs create mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs create mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs delete mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebAutoMapperProfile.cs create mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationAutoMapperProfile.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationAutoMapperProfile.cs deleted file mode 100644 index e7db0c19b9..0000000000 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationAutoMapperProfile.cs +++ /dev/null @@ -1,12 +0,0 @@ -using AutoMapper; - -namespace Volo.Abp.TenantManagement; - -public class AbpTenantManagementApplicationAutoMapperProfile : Profile -{ - public AbpTenantManagementApplicationAutoMapperProfile() - { - CreateMap() - .MapExtraProperties(); - } -} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs new file mode 100644 index 0000000000..9cc4cf5ed5 --- /dev/null +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs @@ -0,0 +1,33 @@ +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace Volo.Abp.TenantManagement.Application.Volo.Abp.TenantManagement; + +[Mapper] +public partial class TenantToTenantDtoMapper + : MapperBase +{ + [MapperIgnoreSource(nameof(Tenant.EntityVersion))] + [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] + [MapperIgnoreSource(nameof(Tenant.IsDeleted))] + [MapperIgnoreSource(nameof(Tenant.NormalizedName))] + [MapperIgnoreSource(nameof(Tenant.DeleterId))] + [MapperIgnoreSource(nameof(Tenant.DeletionTime))] + [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] + [MapperIgnoreSource(nameof(Tenant.LastModifierId))] + [MapperIgnoreSource(nameof(Tenant.CreationTime))] + [MapperIgnoreSource(nameof(Tenant.CreatorId))] + public override partial TenantDto Map(Tenant source); + + [MapperIgnoreSource(nameof(Tenant.EntityVersion))] + [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] + [MapperIgnoreSource(nameof(Tenant.IsDeleted))] + [MapperIgnoreSource(nameof(Tenant.NormalizedName))] + [MapperIgnoreSource(nameof(Tenant.DeleterId))] + [MapperIgnoreSource(nameof(Tenant.DeletionTime))] + [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] + [MapperIgnoreSource(nameof(Tenant.LastModifierId))] + [MapperIgnoreSource(nameof(Tenant.CreationTime))] + [MapperIgnoreSource(nameof(Tenant.CreatorId))] + public override partial void Map(Tenant source, TenantDto destination); +} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs index 2583c06458..4f51d28f82 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationModule.cs @@ -1,6 +1,5 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Application; -using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; namespace Volo.Abp.TenantManagement; @@ -12,10 +11,6 @@ public class AbpTenantManagementApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); + context.Services.AddMapperlyObjectMapper(); } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorAutoMapperProfile.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorAutoMapperProfile.cs deleted file mode 100644 index 28ad6e9b8a..0000000000 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorAutoMapperProfile.cs +++ /dev/null @@ -1,12 +0,0 @@ -using AutoMapper; - -namespace Volo.Abp.TenantManagement.Blazor; - -public class AbpTenantManagementBlazorAutoMapperProfile : Profile -{ - public AbpTenantManagementBlazorAutoMapperProfile() - { - CreateMap() - .MapExtraProperties(); - } -} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs new file mode 100644 index 0000000000..2e0f2b743a --- /dev/null +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs @@ -0,0 +1,15 @@ +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace Volo.Abp.TenantManagement.Blazor; + +[Mapper] +public partial class TenantDtoToTenantUpdateDtoMapper + : MapperBase +{ + [MapperIgnoreSource(nameof(TenantDto.Id))] + public override partial TenantUpdateDto Map(TenantDto source); + + [MapperIgnoreSource(nameof(TenantDto.Id))] + public override partial void Map(TenantDto source, TenantUpdateDto destination); +} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorModule.cs index 0433f2e33b..0263106b43 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorModule.cs @@ -1,7 +1,7 @@ using Localization.Resources.AbpUi; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Components.Web.Theming.Routing; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.FeatureManagement.Blazor; using Volo.Abp.FeatureManagement.Localization; using Volo.Abp.Localization; @@ -16,7 +16,7 @@ using Volo.Abp.UI.Navigation; namespace Volo.Abp.TenantManagement.Blazor; [DependsOn( - typeof(AbpAutoMapperModule), + typeof(AbpMapperlyModule), typeof(AbpTenantManagementApplicationContractsModule), typeof(AbpFeatureManagementBlazorModule) )] @@ -26,12 +26,7 @@ public class AbpTenantManagementBlazorModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAutoMapperObjectMapper(); - - Configure(options => - { - options.AddProfile(validate: true); - }); + context.Services.AddMapperlyObjectMapper(); Configure(options => { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Volo.Abp.TenantManagement.Blazor.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Volo.Abp.TenantManagement.Blazor.csproj index 1afbbf56c7..8e54fdcba0 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Volo.Abp.TenantManagement.Blazor.csproj +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/Volo.Abp.TenantManagement.Blazor.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj index 7a40ae4f71..dcb196ce86 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo.Abp.TenantManagement.Domain.csproj @@ -17,7 +17,7 @@ - + diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs new file mode 100644 index 0000000000..81b9faf1d8 --- /dev/null +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Data; +using Volo.Abp.Mapperly; +using Volo.Abp.MultiTenancy; + +namespace Volo.Abp.TenantManagement.Domain.Volo.Abp.TenantManagement; + +[Mapper] +public partial class TenantToTenantConfigurationMapper + : MapperBase +{ + [MapperIgnoreSource(nameof(Tenant.DeleterId))] + [MapperIgnoreSource(nameof(Tenant.DeletionTime))] + [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] + [MapperIgnoreSource(nameof(Tenant.CreationTime))] + [MapperIgnoreSource(nameof(Tenant.CreatorId))] + [MapperIgnoreSource(nameof(Tenant.LastModifierId))] + [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] + [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] + [MapperIgnoreSource(nameof(Tenant.IsDeleted))] + [MapperIgnoreSource(nameof(Tenant.EntityVersion))] + [MapperIgnoreTarget(nameof(TenantConfiguration.EditionId))] + [MapperIgnoreTarget(nameof(TenantConfiguration.IsActive))] + public override partial TenantConfiguration Map(Tenant source); + + [MapperIgnoreSource(nameof(Tenant.DeleterId))] + [MapperIgnoreSource(nameof(Tenant.DeletionTime))] + [MapperIgnoreSource(nameof(Tenant.IsDeleted))] + [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] + [MapperIgnoreSource(nameof(Tenant.LastModifierId))] + [MapperIgnoreSource(nameof(Tenant.CreationTime))] + [MapperIgnoreSource(nameof(Tenant.CreatorId))] + [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] + [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] + [MapperIgnoreSource(nameof(Tenant.EntityVersion))] + [MapperIgnoreTarget(nameof(TenantConfiguration.EditionId))] + [MapperIgnoreTarget(nameof(TenantConfiguration.IsActive))] + public override partial void Map(Tenant source, TenantConfiguration destination); + + protected virtual ConnectionStrings Map(List source) + { + var connStrings = new ConnectionStrings(); + + if (source == null) + { + return connStrings; + } + + foreach (var connectionString in source) + { + connStrings[connectionString.Name] = connectionString.Value; + } + + return connStrings; + } +} + +[Mapper] +public partial class TenantToTenantEtoMapper + : MapperBase +{ + [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] + [MapperIgnoreSource(nameof(Tenant.IsDeleted))] + [MapperIgnoreSource(nameof(Tenant.NormalizedName))] + [MapperIgnoreSource(nameof(Tenant.DeleterId))] + [MapperIgnoreSource(nameof(Tenant.DeletionTime))] + [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] + [MapperIgnoreSource(nameof(Tenant.LastModifierId))] + [MapperIgnoreSource(nameof(Tenant.CreationTime))] + [MapperIgnoreSource(nameof(Tenant.CreatorId))] + [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] + [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] + public override partial TenantEto Map(Tenant source); + + [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] + [MapperIgnoreSource(nameof(Tenant.IsDeleted))] + [MapperIgnoreSource(nameof(Tenant.NormalizedName))] + [MapperIgnoreSource(nameof(Tenant.DeleterId))] + [MapperIgnoreSource(nameof(Tenant.DeletionTime))] + [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] + [MapperIgnoreSource(nameof(Tenant.LastModifierId))] + [MapperIgnoreSource(nameof(Tenant.CreationTime))] + [MapperIgnoreSource(nameof(Tenant.CreatorId))] + [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] + [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] + public override partial void Map(Tenant source, TenantEto destination); +} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs index 6fe1edafc6..0b0795d681 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs @@ -1,36 +1,36 @@ -using AutoMapper; +// using AutoMapper; using Volo.Abp.Data; using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement; -public class AbpTenantManagementDomainMappingProfile : Profile +public class AbpTenantManagementDomainMappingProfile //: Profile { public AbpTenantManagementDomainMappingProfile() { - CreateMap() - .ForMember(ti => ti.ConnectionStrings, opts => - { - opts.MapFrom((tenant, ti) => - { - var connStrings = new ConnectionStrings(); + // CreateMap() + // .ForMember(ti => ti.ConnectionStrings, opts => + // { + // opts.MapFrom((tenant, ti) => + // { + // var connStrings = new ConnectionStrings(); - if (tenant.ConnectionStrings == null) - { - return connStrings; - } + // if (tenant.ConnectionStrings == null) + // { + // return connStrings; + // } - foreach (var connectionString in tenant.ConnectionStrings) - { - connStrings[connectionString.Name] = connectionString.Value; - } + // foreach (var connectionString in tenant.ConnectionStrings) + // { + // connStrings[connectionString.Name] = connectionString.Value; + // } - return connStrings; - }); - }) - .ForMember(x => x.IsActive, x => x.Ignore()) - .ForMember(x => x.EditionId, x => x.Ignore()); + // return connStrings; + // }); + // }) + // .ForMember(x => x.IsActive, x => x.Ignore()) + // .ForMember(x => x.EditionId, x => x.Ignore()); - CreateMap(); + // CreateMap(); } } diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs index 6bd09809e4..afce2e0809 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainModule.cs @@ -1,5 +1,5 @@ using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.Caching; using Volo.Abp.Data; using Volo.Abp.Domain; @@ -16,7 +16,7 @@ namespace Volo.Abp.TenantManagement; [DependsOn(typeof(AbpTenantManagementDomainSharedModule))] [DependsOn(typeof(AbpDataModule))] [DependsOn(typeof(AbpDddDomainModule))] -[DependsOn(typeof(AbpAutoMapperModule))] +[DependsOn(typeof(AbpMapperlyModule))] [DependsOn(typeof(AbpCachingModule))] public class AbpTenantManagementDomainModule : AbpModule { @@ -24,12 +24,7 @@ public class AbpTenantManagementDomainModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddAutoMapperObjectMapper(); - - Configure(options => - { - options.AddProfile(validate: true); - }); + context.Services.AddMapperlyObjectMapper(); Configure(options => { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebAutoMapperProfile.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebAutoMapperProfile.cs deleted file mode 100644 index 4730033e60..0000000000 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebAutoMapperProfile.cs +++ /dev/null @@ -1,22 +0,0 @@ -using AutoMapper; -using Volo.Abp.AutoMapper; -using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants; - -namespace Volo.Abp.TenantManagement.Web; - -public class AbpTenantManagementWebAutoMapperProfile : Profile -{ - public AbpTenantManagementWebAutoMapperProfile() - { - //List - CreateMap(); - - //CreateModal - CreateMap() - .MapExtraProperties(); - - //EditModal - CreateMap() - .MapExtraProperties(); - } -} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs new file mode 100644 index 0000000000..b27aefe808 --- /dev/null +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; +using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants; + +namespace Volo.Abp.TenantManagement.Web; + +[Mapper] +public partial class TenantDtoToTenantInfoModelMapper + : MapperBase +{ + public override partial EditModalModel.TenantInfoModel Map(TenantDto source); + + public override partial void Map(TenantDto source, EditModalModel.TenantInfoModel destination); +} + +[Mapper] +public partial class TenantInfoModelToTenantCreateDtoMapper + : MapperBase +{ + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] + [MapperIgnoreTarget(nameof(TenantCreateDto.AdminEmailAddress))] + [MapperIgnoreTarget(nameof(TenantCreateDto.AdminPassword))] + public override partial TenantCreateDto Map(EditModalModel.TenantInfoModel source); + + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] + [MapperIgnoreTarget(nameof(TenantCreateDto.AdminEmailAddress))] + [MapperIgnoreTarget(nameof(TenantCreateDto.AdminPassword))] + public override partial void Map(EditModalModel.TenantInfoModel source, TenantCreateDto destination); +} + +[Mapper] +public partial class TenantInfoModelToTenantUpdateDtoMapper + : MapperBase +{ + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] + [MapperIgnoreTarget(nameof(TenantUpdateDto.ConcurrencyStamp))] + public override partial TenantUpdateDto Map(EditModalModel.TenantInfoModel source); + + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] + [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] + [MapperIgnoreTarget(nameof(TenantUpdateDto.ConcurrencyStamp))] + public override partial void Map(EditModalModel.TenantInfoModel source, TenantUpdateDto destination); +} \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs index b3a63fb8ae..db59b04869 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.PageToolbars; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.FeatureManagement; using Volo.Abp.Http.ProxyScripting.Generators.JQuery; using Volo.Abp.Localization; @@ -21,7 +21,7 @@ namespace Volo.Abp.TenantManagement.Web; [DependsOn(typeof(AbpTenantManagementApplicationContractsModule))] [DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))] [DependsOn(typeof(AbpFeatureManagementWebModule))] -[DependsOn(typeof(AbpAutoMapperModule))] +[DependsOn(typeof(AbpMapperlyModule))] public class AbpTenantManagementWebModule : AbpModule { private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); @@ -51,11 +51,7 @@ public class AbpTenantManagementWebModule : AbpModule options.FileSets.AddEmbedded(); }); - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddProfile(validate: true); - }); + context.Services.AddMapperlyObjectMapper(); Configure(options => { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj index 0fe0724f15..59d7e74c6b 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/Volo.Abp.TenantManagement.Web.csproj @@ -35,7 +35,7 @@ - + From 54f773f18fc74d9227768db50747084b7523971d Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Thu, 28 Aug 2025 08:13:07 +0300 Subject: [PATCH 2/6] Migrate from AutoMapper to Mapperly in tenant management Replaced AutoMapper usage with Mapperly in tenant management and MVC template modules. Removed obsolete AutoMapper mapping profile, updated project references and module dependencies, and refactored mapping configuration methods to use Mapperly. --- ...bpTenantManagementDomainMapperlyMappers.cs | 22 +----------- ...AbpTenantManagementDomainMappingProfile.cs | 36 ------------------- .../AbpTenantManagementWebMapperlyMappers.cs | 7 +++- .../MyCompanyName.MyProjectName.Mvc.csproj | 2 +- .../MyProjectNameModule.cs | 19 ++++------ 5 files changed, 14 insertions(+), 72 deletions(-) delete mode 100644 modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs index 81b9faf1d8..d2904c844b 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs @@ -7,34 +7,14 @@ using Volo.Abp.MultiTenancy; namespace Volo.Abp.TenantManagement.Domain.Volo.Abp.TenantManagement; -[Mapper] +[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] public partial class TenantToTenantConfigurationMapper : MapperBase { - [MapperIgnoreSource(nameof(Tenant.DeleterId))] - [MapperIgnoreSource(nameof(Tenant.DeletionTime))] - [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] - [MapperIgnoreSource(nameof(Tenant.CreationTime))] - [MapperIgnoreSource(nameof(Tenant.CreatorId))] - [MapperIgnoreSource(nameof(Tenant.LastModifierId))] - [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] - [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] - [MapperIgnoreSource(nameof(Tenant.IsDeleted))] - [MapperIgnoreSource(nameof(Tenant.EntityVersion))] [MapperIgnoreTarget(nameof(TenantConfiguration.EditionId))] [MapperIgnoreTarget(nameof(TenantConfiguration.IsActive))] public override partial TenantConfiguration Map(Tenant source); - [MapperIgnoreSource(nameof(Tenant.DeleterId))] - [MapperIgnoreSource(nameof(Tenant.DeletionTime))] - [MapperIgnoreSource(nameof(Tenant.IsDeleted))] - [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] - [MapperIgnoreSource(nameof(Tenant.LastModifierId))] - [MapperIgnoreSource(nameof(Tenant.CreationTime))] - [MapperIgnoreSource(nameof(Tenant.CreatorId))] - [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] - [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] - [MapperIgnoreSource(nameof(Tenant.EntityVersion))] [MapperIgnoreTarget(nameof(TenantConfiguration.EditionId))] [MapperIgnoreTarget(nameof(TenantConfiguration.IsActive))] public override partial void Map(Tenant source, TenantConfiguration destination); diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs deleted file mode 100644 index 0b0795d681..0000000000 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMappingProfile.cs +++ /dev/null @@ -1,36 +0,0 @@ -// using AutoMapper; -using Volo.Abp.Data; -using Volo.Abp.MultiTenancy; - -namespace Volo.Abp.TenantManagement; - -public class AbpTenantManagementDomainMappingProfile //: Profile -{ - public AbpTenantManagementDomainMappingProfile() - { - // CreateMap() - // .ForMember(ti => ti.ConnectionStrings, opts => - // { - // opts.MapFrom((tenant, ti) => - // { - // var connStrings = new ConnectionStrings(); - - // if (tenant.ConnectionStrings == null) - // { - // return connStrings; - // } - - // foreach (var connectionString in tenant.ConnectionStrings) - // { - // connStrings[connectionString.Name] = connectionString.Value; - // } - - // return connStrings; - // }); - // }) - // .ForMember(x => x.IsActive, x => x.Ignore()) - // .ForMember(x => x.EditionId, x => x.Ignore()); - - // CreateMap(); - } -} diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs index b27aefe808..7b6f3d389d 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Riok.Mapperly.Abstractions; +using Volo.Abp.DependencyInjection; using Volo.Abp.Mapperly; using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants; @@ -19,7 +20,7 @@ public partial class TenantDtoToTenantInfoModelMapper [Mapper] public partial class TenantInfoModelToTenantCreateDtoMapper - : MapperBase + : TwoWayMapperBase { [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] @@ -32,6 +33,10 @@ public partial class TenantInfoModelToTenantCreateDtoMapper [MapperIgnoreTarget(nameof(TenantCreateDto.AdminEmailAddress))] [MapperIgnoreTarget(nameof(TenantCreateDto.AdminPassword))] public override partial void Map(EditModalModel.TenantInfoModel source, TenantCreateDto destination); + + public override partial EditModalModel.TenantInfoModel ReverseMap(TenantCreateDto source); + + public override partial void ReverseMap(TenantCreateDto source, EditModalModel.TenantInfoModel destination); } [Mapper] diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj index 3d70cebc18..148f1afd74 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyCompanyName.MyProjectName.Mvc.csproj @@ -23,7 +23,7 @@ - + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyProjectNameModule.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyProjectNameModule.cs index e8c99fc852..39aa8b36c1 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyProjectNameModule.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Mvc/MyProjectNameModule.cs @@ -18,7 +18,7 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Autofac; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.Emailing; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.SqlServer; @@ -57,7 +57,7 @@ namespace MyCompanyName.MyProjectName; // ABP Framework packages typeof(AbpAspNetCoreMvcModule), typeof(AbpAutofacModule), - typeof(AbpAutoMapperModule), + typeof(AbpMapperlyModule), typeof(AbpEntityFrameworkCoreSqlServerModule), typeof(AbpSwashbuckleModule), typeof(AbpAspNetCoreSerilogModule), @@ -162,7 +162,7 @@ public class MyProjectNameModule : AbpModule ConfigureMultiTenancy(); ConfigureUrls(configuration); ConfigureBundles(); - ConfigureAutoMapper(context); + ConfigureMapperly(context); ConfigureSwagger(context.Services); ConfigureNavigationServices(); ConfigureAutoApiControllers(); @@ -291,17 +291,10 @@ public class MyProjectNameModule : AbpModule ); } - private void ConfigureAutoMapper(ServiceConfigurationContext context) + private void ConfigureMapperly(ServiceConfigurationContext context) { - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - /* Uncomment `validate: true` if you want to enable the Configuration Validation feature. - * See AutoMapper's documentation to learn what it is: - * https://docs.automapper.org/en/stable/Configuration-validation.html - */ - options.AddMaps(/* validate: true */); - }); + context.Services.AddMapperlyObjectMapper(); + context.Services.AddMapperlyObjectMapper(); } private void ConfigureEfCore(ServiceConfigurationContext context) From 47352e8b920ea1138abfcc6ad0d3693094422db5 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Thu, 28 Aug 2025 09:11:40 +0300 Subject: [PATCH 3/6] Update AbpTenantManagementWebModule.cs --- .../AbpTenantManagementWebModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs index db59b04869..90dc1df3d6 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebModule.cs @@ -41,6 +41,8 @@ public class AbpTenantManagementWebModule : AbpModule public override void ConfigureServices(ServiceConfigurationContext context) { + context.Services.AddMapperlyObjectMapper(); + Configure(options => { options.MenuContributors.Add(new AbpTenantManagementWebMainMenuContributor()); @@ -51,8 +53,6 @@ public class AbpTenantManagementWebModule : AbpModule options.FileSets.AddEmbedded(); }); - context.Services.AddMapperlyObjectMapper(); - Configure(options => { options.Conventions.AuthorizePage("/TenantManagement/Tenants/Index", TenantManagementPermissions.Tenants.Default); From a0551df0c055630c0706b1bfc6fd290fc4f7f565 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Thu, 28 Aug 2025 10:11:12 +0300 Subject: [PATCH 4/6] Update AbpTenantManagementApplicationMapperlyMappers.cs --- ...antManagementApplicationMapperlyMappers.cs | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs index 9cc4cf5ed5..88ab1684c0 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs @@ -3,31 +3,10 @@ using Volo.Abp.Mapperly; namespace Volo.Abp.TenantManagement.Application.Volo.Abp.TenantManagement; -[Mapper] -public partial class TenantToTenantDtoMapper +[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] +public partial class TenantToTenantDtoMapper : MapperBase { - [MapperIgnoreSource(nameof(Tenant.EntityVersion))] - [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] - [MapperIgnoreSource(nameof(Tenant.IsDeleted))] - [MapperIgnoreSource(nameof(Tenant.NormalizedName))] - [MapperIgnoreSource(nameof(Tenant.DeleterId))] - [MapperIgnoreSource(nameof(Tenant.DeletionTime))] - [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] - [MapperIgnoreSource(nameof(Tenant.LastModifierId))] - [MapperIgnoreSource(nameof(Tenant.CreationTime))] - [MapperIgnoreSource(nameof(Tenant.CreatorId))] public override partial TenantDto Map(Tenant source); - - [MapperIgnoreSource(nameof(Tenant.EntityVersion))] - [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] - [MapperIgnoreSource(nameof(Tenant.IsDeleted))] - [MapperIgnoreSource(nameof(Tenant.NormalizedName))] - [MapperIgnoreSource(nameof(Tenant.DeleterId))] - [MapperIgnoreSource(nameof(Tenant.DeletionTime))] - [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] - [MapperIgnoreSource(nameof(Tenant.LastModifierId))] - [MapperIgnoreSource(nameof(Tenant.CreationTime))] - [MapperIgnoreSource(nameof(Tenant.CreatorId))] public override partial void Map(Tenant source, TenantDto destination); } \ No newline at end of file From 2d30749cff4e88f39e4c10c11f64ee9d1d85cff4 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Thu, 28 Aug 2025 11:54:33 +0300 Subject: [PATCH 5/6] Refactor tenant create mapper to use CreateModalModel Renamed TenantInfoModelToTenantCreateDtoMapper to CreateTenantInfoModelToTenantCreateDtoMapper and updated all method signatures to use CreateModalModel.TenantInfoModel instead of EditModalModel.TenantInfoModel. This clarifies the mapper's purpose and aligns it with the correct model context. --- .../AbpTenantManagementWebMapperlyMappers.cs | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs index 7b6f3d389d..4ff9739146 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs @@ -19,24 +19,16 @@ public partial class TenantDtoToTenantInfoModelMapper } [Mapper] -public partial class TenantInfoModelToTenantCreateDtoMapper - : TwoWayMapperBase +public partial class CreateTenantInfoModelToTenantCreateDtoMapper + : TwoWayMapperBase { - [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] - [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] - [MapperIgnoreTarget(nameof(TenantCreateDto.AdminEmailAddress))] - [MapperIgnoreTarget(nameof(TenantCreateDto.AdminPassword))] - public override partial TenantCreateDto Map(EditModalModel.TenantInfoModel source); + public override partial TenantCreateDto Map(CreateModalModel.TenantInfoModel source); - [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.Id))] - [MapperIgnoreSource(nameof(EditModalModel.TenantInfoModel.ConcurrencyStamp))] - [MapperIgnoreTarget(nameof(TenantCreateDto.AdminEmailAddress))] - [MapperIgnoreTarget(nameof(TenantCreateDto.AdminPassword))] - public override partial void Map(EditModalModel.TenantInfoModel source, TenantCreateDto destination); + public override partial void Map(CreateModalModel.TenantInfoModel source, TenantCreateDto destination); - public override partial EditModalModel.TenantInfoModel ReverseMap(TenantCreateDto source); + public override partial CreateModalModel.TenantInfoModel ReverseMap(TenantCreateDto source); - public override partial void ReverseMap(TenantCreateDto source, EditModalModel.TenantInfoModel destination); + public override partial void ReverseMap(TenantCreateDto source, CreateModalModel.TenantInfoModel destination); } [Mapper] From 08b7b643fbee3c55b5ce65782e4142d3da7556ac Mon Sep 17 00:00:00 2001 From: enisn Date: Fri, 29 Aug 2025 13:40:48 +0300 Subject: [PATCH 6/6] Update tenant mappers & include ExtraProperties --- ...antManagementApplicationMapperlyMappers.cs | 1 + ...bpTenantManagementBlazorMapperlyMappers.cs | 1 + ...bpTenantManagementDomainMapperlyMappers.cs | 24 +------------------ .../AbpTenantManagementWebMapperlyMappers.cs | 3 +++ 4 files changed, 6 insertions(+), 23 deletions(-) diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs index 88ab1684c0..c3f44f2129 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Application/Volo/Abp/TenantManagement/AbpTenantManagementApplicationMapperlyMappers.cs @@ -4,6 +4,7 @@ using Volo.Abp.Mapperly; namespace Volo.Abp.TenantManagement.Application.Volo.Abp.TenantManagement; [Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] +[MapExtraProperties] public partial class TenantToTenantDtoMapper : MapperBase { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs index 2e0f2b743a..7b8ea2a5bf 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Blazor/AbpTenantManagementBlazorMapperlyMappers.cs @@ -4,6 +4,7 @@ using Volo.Abp.Mapperly; namespace Volo.Abp.TenantManagement.Blazor; [Mapper] +[MapExtraProperties] public partial class TenantDtoToTenantUpdateDtoMapper : MapperBase { diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs index d2904c844b..29ae9f21fe 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/AbpTenantManagementDomainMapperlyMappers.cs @@ -37,33 +37,11 @@ public partial class TenantToTenantConfigurationMapper } } -[Mapper] +[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] public partial class TenantToTenantEtoMapper : MapperBase { - [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] - [MapperIgnoreSource(nameof(Tenant.IsDeleted))] - [MapperIgnoreSource(nameof(Tenant.NormalizedName))] - [MapperIgnoreSource(nameof(Tenant.DeleterId))] - [MapperIgnoreSource(nameof(Tenant.DeletionTime))] - [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] - [MapperIgnoreSource(nameof(Tenant.LastModifierId))] - [MapperIgnoreSource(nameof(Tenant.CreationTime))] - [MapperIgnoreSource(nameof(Tenant.CreatorId))] - [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] - [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] public override partial TenantEto Map(Tenant source); - [MapperIgnoreSource(nameof(Tenant.ConnectionStrings))] - [MapperIgnoreSource(nameof(Tenant.IsDeleted))] - [MapperIgnoreSource(nameof(Tenant.NormalizedName))] - [MapperIgnoreSource(nameof(Tenant.DeleterId))] - [MapperIgnoreSource(nameof(Tenant.DeletionTime))] - [MapperIgnoreSource(nameof(Tenant.LastModificationTime))] - [MapperIgnoreSource(nameof(Tenant.LastModifierId))] - [MapperIgnoreSource(nameof(Tenant.CreationTime))] - [MapperIgnoreSource(nameof(Tenant.CreatorId))] - [MapperIgnoreSource(nameof(Tenant.ExtraProperties))] - [MapperIgnoreSource(nameof(Tenant.ConcurrencyStamp))] public override partial void Map(Tenant source, TenantEto destination); } \ No newline at end of file diff --git a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs index 4ff9739146..d729809010 100644 --- a/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs +++ b/modules/tenant-management/src/Volo.Abp.TenantManagement.Web/AbpTenantManagementWebMapperlyMappers.cs @@ -10,6 +10,7 @@ using Volo.Abp.TenantManagement.Web.Pages.TenantManagement.Tenants; namespace Volo.Abp.TenantManagement.Web; [Mapper] +[MapExtraProperties] public partial class TenantDtoToTenantInfoModelMapper : MapperBase { @@ -19,6 +20,7 @@ public partial class TenantDtoToTenantInfoModelMapper } [Mapper] +[MapExtraProperties] public partial class CreateTenantInfoModelToTenantCreateDtoMapper : TwoWayMapperBase { @@ -32,6 +34,7 @@ public partial class CreateTenantInfoModelToTenantCreateDtoMapper } [Mapper] +[MapExtraProperties] public partial class TenantInfoModelToTenantUpdateDtoMapper : MapperBase {