From 1a45faf54cdcb6625f6d1260d51efcd324a4b738 Mon Sep 17 00:00:00 2001 From: liangshiwei Date: Sat, 24 Jan 2026 22:31:49 +0800 Subject: [PATCH] Migrate from AutoMapper to Mapperly across solution Replaces all usages of Volo.Abp.AutoMapper with Volo.Abp.Mapperly in project files, modules, and service registrations. Removes AutoMapper profile classes and introduces Mapperly-based mapper classes where needed. Updates dependency declarations and module dependencies to use Mapperly, ensuring consistent mapping configuration throughout the codebase. --- Directory.Packages.props | 2 +- common.props | 2 +- ...pFeatureManagementBlazorAntDesignModule.cs | 4 +-- ...eatureManagement.Blazor.AntDesignUI.csproj | 2 +- ...entityBlazorAntDesignApplicationMappers.cs | 27 +++++++++++++++++++ ...dentityBlazorAntDesignAutoMapperProfile.cs | 19 ------------- .../AbpIdentityBlazorAntDesignModule.cs | 11 +++----- ...entityManagement.Blazor.AntDesignUI.csproj | 2 +- ...rmissionManagementBlazorAntDesignModule.cs | 4 +-- ...issionManagement.Blazor.AntDesignUI.csproj | 2 +- ...pSettingManagementBlazorAntDesignModule.cs | 12 +++------ ...ettingManagement.Blazor.AntDesignUI.csproj | 2 +- ...ttingManagementBlazorApplicationMappers.cs | 13 +++++++++ ...ettingManagementBlazorAutoMapperProfile.cs | 12 --------- ...bpTenantManagementBlazorAntDesignModule.cs | 11 +++----- ...enantManagementBlazorApplicationMappers.cs | 14 ++++++++++ ...TenantManagementBlazorAutoMapperProfile.cs | 13 --------- ...TenantManagement.Blazor.AntDesignUI.csproj | 2 +- nuget/0 | 1 - .../BookStore.Application.csproj | 4 +-- .../BookStoreApplicationAutoMapperProfile.cs | 13 --------- .../BookStoreApplicationMappers.cs | 13 +++++++++ .../BookStoreApplicationModule.cs | 10 +++---- .../BookStoreBlazorAutoMapperProfile.cs | 11 -------- .../BookStoreBlazorClientModule.cs | 12 ++++----- .../BookStoreBlazorMappers.cs | 13 +++++++++ .../BookStoreBlazorAutoMapperProfile.cs | 11 -------- .../BookStoreBlazorMappers.cs | 13 +++++++++ .../BookStore.Blazor/BookStoreBlazorModule.cs | 14 +++++----- .../BookStore.Application.csproj | 4 +-- .../BookStoreApplicationAutoMapperProfile.cs | 13 --------- .../BookStoreApplicationMappers.cs | 13 +++++++++ .../BookStoreApplicationModule.cs | 10 +++---- .../BookStoreBlazorApplicationMappers.cs | 13 +++++++++ .../BookStoreBlazorAutoMapperProfile.cs | 11 -------- .../BookStore.Blazor/BookStoreBlazorModule.cs | 14 +++++----- .../BookStore.Application.csproj | 4 +-- .../BookStoreApplicationApplicationMappers.cs | 13 +++++++++ .../BookStoreApplicationAutoMapperProfile.cs | 13 --------- .../BookStoreApplicationModule.cs | 10 +++---- .../BookStoreBlazorAutoMapperProfile.cs | 11 -------- .../BookStoreBlazorClientModule.cs | 12 ++++----- .../BookStoreBlazorMappers.cs | 13 +++++++++ 43 files changed, 205 insertions(+), 218 deletions(-) create mode 100644 modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignApplicationMappers.cs delete mode 100644 modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignAutoMapperProfile.cs create mode 100644 modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorApplicationMappers.cs delete mode 100644 modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorAutoMapperProfile.cs create mode 100644 modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorApplicationMappers.cs delete mode 100644 modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAutoMapperProfile.cs delete mode 100644 nuget/0 delete mode 100644 samples/WebApp/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs create mode 100644 samples/WebApp/src/BookStore.Application/BookStoreApplicationMappers.cs delete mode 100644 samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs create mode 100644 samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs delete mode 100644 samples/WebApp/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs create mode 100644 samples/WebApp/src/BookStore.Blazor/BookStoreBlazorMappers.cs delete mode 100644 samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs create mode 100644 samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationMappers.cs create mode 100644 samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorApplicationMappers.cs delete mode 100644 samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs create mode 100644 samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationApplicationMappers.cs delete mode 100644 samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs delete mode 100644 samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs create mode 100644 samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 6c79670..778c511 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -26,7 +26,7 @@ - + diff --git a/common.props b/common.props index 6bacfd2..195afd1 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 0.9.9.1 + 0.9.9.2 https://raw.githubusercontent.com/realliangshiwei/Lsw.Abp.AntDesignUI/main/icon.png https://github.com/realLiangshiwei/Lsw.Abp.AntDesignUI MIT diff --git a/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/AbpFeatureManagementBlazorAntDesignModule.cs b/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/AbpFeatureManagementBlazorAntDesignModule.cs index cfbc7d3..8e519b3 100644 --- a/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/AbpFeatureManagementBlazorAntDesignModule.cs +++ b/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/AbpFeatureManagementBlazorAntDesignModule.cs @@ -1,14 +1,14 @@ using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme; -using Volo.Abp.AutoMapper; using Volo.Abp.FeatureManagement; using Volo.Abp.Features; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; namespace Lsw.Abp.FeatureManagement.Blazor.AntDesignUI; [DependsOn( typeof(AbpAspNetCoreComponentsWebAntDesignThemeModule), - typeof(AbpAutoMapperModule), + typeof(AbpMapperlyModule), typeof(AbpFeatureManagementApplicationContractsModule), typeof(AbpFeaturesModule) )] diff --git a/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI.csproj b/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI.csproj index 9501bd2..c757210 100644 --- a/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI.csproj +++ b/modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignApplicationMappers.cs b/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignApplicationMappers.cs new file mode 100644 index 0000000..259eed7 --- /dev/null +++ b/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignApplicationMappers.cs @@ -0,0 +1,27 @@ +using Riok.Mapperly.Abstractions; +using Volo.Abp.Identity; +using Volo.Abp.Mapperly; + +namespace Lsw.Abp.IdentityManagement.Blazor.AntDesignUI; + +[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] +[MapExtraProperties] +public partial class IdentityUserBlazorMapper : MapperBase +{ + [MapperIgnoreTarget(nameof(IdentityUserUpdateDto.Password))] + [MapperIgnoreTarget(nameof(IdentityUserUpdateDto.RoleNames))] + public override partial IdentityUserUpdateDto Map(IdentityUserDto source); + + [MapperIgnoreTarget(nameof(IdentityUserUpdateDto.Password))] + [MapperIgnoreTarget(nameof(IdentityUserUpdateDto.RoleNames))] + public override partial void Map(IdentityUserDto source, IdentityUserUpdateDto destination); +} + +[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] +[MapExtraProperties] +public partial class IdentityRoleBlazorMapper : MapperBase +{ + public override partial IdentityRoleUpdateDto Map(IdentityRoleDto source); + + public override partial void Map(IdentityRoleDto source, IdentityRoleUpdateDto destination); +} diff --git a/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignAutoMapperProfile.cs b/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignAutoMapperProfile.cs deleted file mode 100644 index cb1e51b..0000000 --- a/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignAutoMapperProfile.cs +++ /dev/null @@ -1,19 +0,0 @@ -using AutoMapper; -using Volo.Abp.AutoMapper; -using Volo.Abp.Identity; - -namespace Lsw.Abp.IdentityManagement.Blazor.AntDesignUI; - -public class AbpIdentityBlazorAntDesignAutoMapperProfile: Profile -{ - public AbpIdentityBlazorAntDesignAutoMapperProfile() - { - CreateMap() - .MapExtraProperties() - .Ignore(x => x.Password) - .Ignore(x => x.RoleNames); - - CreateMap() - .MapExtraProperties(); - } -} diff --git a/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignModule.cs b/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignModule.cs index 21f87c9..52c9171 100644 --- a/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignModule.cs +++ b/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignModule.cs @@ -3,8 +3,8 @@ using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme; using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Routing; using Lsw.Abp.PermissionManagement.Blazor.AntDesignUI; using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; using Volo.Abp.Identity; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectExtending.Modularity; @@ -15,7 +15,7 @@ namespace Lsw.Abp.IdentityManagement.Blazor.AntDesignUI; [DependsOn( typeof(AbpIdentityApplicationContractsModule), - typeof(AbpAutoMapperModule), + typeof(AbpMapperlyModule), typeof(AbpPermissionManagementBlazorAntDesignModule), typeof(AbpAspNetCoreComponentsWebAntDesignThemeModule), typeof(AbpAntDesignUIModule) @@ -26,12 +26,7 @@ public class AbpIdentityBlazorAntDesignModule: 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/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI.csproj b/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI.csproj index bec4c72..3ba6d3e 100644 --- a/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI.csproj +++ b/modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/AbpPermissionManagementBlazorAntDesignModule.cs b/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/AbpPermissionManagementBlazorAntDesignModule.cs index 442e178..cece34e 100644 --- a/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/AbpPermissionManagementBlazorAntDesignModule.cs +++ b/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/AbpPermissionManagementBlazorAntDesignModule.cs @@ -1,5 +1,5 @@ using Lsw.Abp.AntDesignUI; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; @@ -7,7 +7,7 @@ namespace Lsw.Abp.PermissionManagement.Blazor.AntDesignUI; [DependsOn( typeof(AbpAntDesignUIModule), - typeof(AbpAutoMapperModule), + typeof(AbpMapperlyModule), typeof(AbpPermissionManagementApplicationContractsModule) )] public class AbpPermissionManagementBlazorAntDesignModule : AbpModule diff --git a/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI.csproj b/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI.csproj index fd586bd..835f111 100644 --- a/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI.csproj +++ b/modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/AbpSettingManagementBlazorAntDesignModule.cs b/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/AbpSettingManagementBlazorAntDesignModule.cs index bab45e2..6199d24 100644 --- a/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/AbpSettingManagementBlazorAntDesignModule.cs +++ b/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/AbpSettingManagementBlazorAntDesignModule.cs @@ -1,8 +1,7 @@ -using AutoMapper; using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme; using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Routing; using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Lsw.Abp.SettingManagement.Blazor.AntDesignUI.Settings; using Volo.Abp.SettingManagement; @@ -12,7 +11,7 @@ using Volo.Abp.UI.Navigation; namespace Lsw.Abp.SettingManagement.Blazor.AntDesignUI; [DependsOn( - typeof(AbpAutoMapperModule), + typeof(AbpMapperlyModule), typeof(AbpSettingManagementApplicationContractsModule), typeof(AbpAspNetCoreComponentsWebAntDesignThemeModule) )] @@ -20,12 +19,7 @@ public class AbpSettingManagementBlazorAntDesignModule : 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/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/Lsw.Abp.SettingManagement.Blazor.AntDesignUI.csproj b/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/Lsw.Abp.SettingManagement.Blazor.AntDesignUI.csproj index 667adea..589c35b 100644 --- a/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/Lsw.Abp.SettingManagement.Blazor.AntDesignUI.csproj +++ b/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/Lsw.Abp.SettingManagement.Blazor.AntDesignUI.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorApplicationMappers.cs b/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorApplicationMappers.cs new file mode 100644 index 0000000..0c38c8f --- /dev/null +++ b/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorApplicationMappers.cs @@ -0,0 +1,13 @@ +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; +using Volo.Abp.SettingManagement; + +namespace Lsw.Abp.SettingManagement.Blazor.AntDesignUI; + +[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] +public partial class SettingManagementBlazorMapper : MapperBase +{ + public override partial UpdateEmailSettingsDto Map(EmailSettingsDto source); + + public override partial void Map(EmailSettingsDto source, UpdateEmailSettingsDto destination); +} diff --git a/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorAutoMapperProfile.cs b/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorAutoMapperProfile.cs deleted file mode 100644 index c97e66b..0000000 --- a/modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorAutoMapperProfile.cs +++ /dev/null @@ -1,12 +0,0 @@ -using AutoMapper; -using Volo.Abp.SettingManagement; - -namespace Lsw.Abp.SettingManagement.Blazor.AntDesignUI; - -public class SettingManagementBlazorAutoMapperProfile : Profile -{ - public SettingManagementBlazorAutoMapperProfile() - { - CreateMap(); - } -} diff --git a/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAntDesignModule.cs b/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAntDesignModule.cs index ca56991..6db8836 100644 --- a/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAntDesignModule.cs +++ b/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAntDesignModule.cs @@ -1,7 +1,7 @@ using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Routing; using Lsw.Abp.FeatureManagement.Blazor.AntDesignUI; using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectExtending.Modularity; @@ -13,7 +13,7 @@ namespace Lsw.Abp.TenantManagement.Blazor.AntDesignUI; [DependsOn( - typeof(AbpAutoMapperModule), + typeof(AbpMapperlyModule), typeof(AbpTenantManagementApplicationContractsModule), typeof(AbpFeatureManagementBlazorAntDesignModule) )] @@ -23,12 +23,7 @@ public class AbpTenantManagementBlazorAntDesignModule : 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/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorApplicationMappers.cs b/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorApplicationMappers.cs new file mode 100644 index 0000000..9e3e269 --- /dev/null +++ b/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorApplicationMappers.cs @@ -0,0 +1,14 @@ +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; +using Volo.Abp.TenantManagement; + +namespace Lsw.Abp.TenantManagement.Blazor.AntDesignUI; + +[Mapper(RequiredMappingStrategy = RequiredMappingStrategy.Target)] +[MapExtraProperties] +public partial class AbpTenantManagementBlazorMapper : MapperBase +{ + public override partial TenantUpdateDto Map(TenantDto source); + + public override partial void Map(TenantDto source, TenantUpdateDto destination); +} diff --git a/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAutoMapperProfile.cs b/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAutoMapperProfile.cs deleted file mode 100644 index 1c550b9..0000000 --- a/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAutoMapperProfile.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoMapper; -using Volo.Abp.TenantManagement; - -namespace Lsw.Abp.TenantManagement.Blazor.AntDesignUI; - -public class AbpTenantManagementBlazorAutoMapperProfile : Profile -{ - public AbpTenantManagementBlazorAutoMapperProfile() - { - CreateMap() - .MapExtraProperties(); - } -} diff --git a/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/Lsw.Abp.TenantManagement.Blazor.AntDesignUI.csproj b/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/Lsw.Abp.TenantManagement.Blazor.AntDesignUI.csproj index 49c11d5..f425d13 100644 --- a/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/Lsw.Abp.TenantManagement.Blazor.AntDesignUI.csproj +++ b/modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/Lsw.Abp.TenantManagement.Blazor.AntDesignUI.csproj @@ -8,7 +8,7 @@ - + diff --git a/nuget/0 b/nuget/0 deleted file mode 100644 index 573541a..0000000 --- a/nuget/0 +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/samples/WebApp/src/BookStore.Application/BookStore.Application.csproj b/samples/WebApp/src/BookStore.Application/BookStore.Application.csproj index af908bb..69916c3 100644 --- a/samples/WebApp/src/BookStore.Application/BookStore.Application.csproj +++ b/samples/WebApp/src/BookStore.Application/BookStore.Application.csproj @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/samples/WebApp/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs b/samples/WebApp/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs deleted file mode 100644 index 8c6108c..0000000 --- a/samples/WebApp/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoMapper; - -namespace BookStore; - -public class BookStoreApplicationAutoMapperProfile : Profile -{ - public BookStoreApplicationAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - } -} diff --git a/samples/WebApp/src/BookStore.Application/BookStoreApplicationMappers.cs b/samples/WebApp/src/BookStore.Application/BookStoreApplicationMappers.cs new file mode 100644 index 0000000..af509dc --- /dev/null +++ b/samples/WebApp/src/BookStore.Application/BookStoreApplicationMappers.cs @@ -0,0 +1,13 @@ +using System; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace BookStore; + +[Mapper] +public partial class BookStoreApplicationMapper +{ + + + +} diff --git a/samples/WebApp/src/BookStore.Application/BookStoreApplicationModule.cs b/samples/WebApp/src/BookStore.Application/BookStoreApplicationModule.cs index 2c58633..bb22087 100644 --- a/samples/WebApp/src/BookStore.Application/BookStoreApplicationModule.cs +++ b/samples/WebApp/src/BookStore.Application/BookStoreApplicationModule.cs @@ -2,10 +2,11 @@ using Volo.Abp.SettingManagement; using Volo.Abp.Account; using Volo.Abp.Identity; -using Volo.Abp.AutoMapper; using Volo.Abp.FeatureManagement; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.TenantManagement; +using Microsoft.Extensions.DependencyInjection; namespace BookStore; @@ -18,15 +19,12 @@ namespace BookStore; typeof(AbpAccountApplicationModule), typeof(AbpTenantManagementApplicationModule), typeof(AbpSettingManagementApplicationModule), - typeof(AbpAutoMapperModule) + typeof(AbpMapperlyModule) )] public class BookStoreApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { - Configure(options => - { - options.AddMaps(); - }); + context.Services.AddMapperlyObjectMapper(); } } diff --git a/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs b/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs deleted file mode 100644 index 3925cd6..0000000 --- a/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs +++ /dev/null @@ -1,11 +0,0 @@ -using AutoMapper; - -namespace BookStore.Blazor.Client; - -public class BookStoreBlazorAutoMapperProfile : Profile -{ - public BookStoreBlazorAutoMapperProfile() - { - //Define your AutoMapper configuration here for the Blazor project. - } -} diff --git a/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs b/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs index 3ba3112..d6f2cf7 100644 --- a/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs +++ b/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs @@ -10,7 +10,7 @@ using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Routing; using OpenIddict.Abstractions; using Volo.Abp.AspNetCore.Components.Web; using Volo.Abp.Autofac.WebAssembly; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; using Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme; @@ -34,6 +34,7 @@ namespace BookStore.Blazor.Client; typeof(AbpTenantManagementBlazorWebAssemblyAntDesignModule), typeof(AbpAspNetCoreComponentsWebAssemblyAntDesignThemeModule), typeof(AbpAutofacWebAssemblyModule), + typeof(AbpMapperlyModule), typeof(BookStoreHttpApiClientModule) )] public class BookStoreBlazorClientModule : AbpModule @@ -56,7 +57,7 @@ public class BookStoreBlazorClientModule : AbpModule //ConfigureBlazorise(context); ConfigureRouter(context); ConfigureMenu(context); - ConfigureAutoMapper(context); + ConfigureMapperly(context); } @@ -97,11 +98,8 @@ public class BookStoreBlazorClientModule : AbpModule }); } - private void ConfigureAutoMapper(ServiceConfigurationContext context) + private void ConfigureMapperly(ServiceConfigurationContext context) { - Configure(options => - { - options.AddMaps(); - }); + context.Services.AddMapperlyObjectMapper(); } } diff --git a/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs b/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs new file mode 100644 index 0000000..9cf054f --- /dev/null +++ b/samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs @@ -0,0 +1,13 @@ +using System; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace BookStore; + +[Mapper] +public partial class BookStoreBlazorClientMapper +{ + + + +} diff --git a/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs b/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs deleted file mode 100644 index 140ddf6..0000000 --- a/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs +++ /dev/null @@ -1,11 +0,0 @@ -using AutoMapper; - -namespace BookStore.Blazor; - -public class BookStoreBlazorAutoMapperProfile : Profile -{ - public BookStoreBlazorAutoMapperProfile() - { - //Define your AutoMapper configuration here for the Blazor project. - } -} diff --git a/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorMappers.cs b/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorMappers.cs new file mode 100644 index 0000000..2a69123 --- /dev/null +++ b/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorMappers.cs @@ -0,0 +1,13 @@ +using System; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace BookStore; + +[Mapper] +public partial class BookStoreBlazorMapper +{ + + + +} diff --git a/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorModule.cs b/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorModule.cs index f10ca81..a22f8d1 100644 --- a/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorModule.cs +++ b/samples/WebApp/src/BookStore.Blazor/BookStoreBlazorModule.cs @@ -30,12 +30,12 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.Autofac; -using Volo.Abp.AutoMapper; using Volo.Abp.Security.Claims; using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; using Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.Bundling; using Volo.Abp.Localization; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.Swashbuckle; using Volo.Abp.UI.Navigation; @@ -63,7 +63,8 @@ namespace BookStore.Blazor; // typeof(AbpAspNetCoreComponentsWebAssemblyLeptonXLiteThemeBundlingModule), typeof(AbpAspNetCoreComponentsWebAssemblyAntDesignThemeBundlingModule), typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), - typeof(AbpAspNetCoreSerilogModule) + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpMapperlyModule) )] public class BookStoreBlazorModule : AbpModule { @@ -141,7 +142,7 @@ public class BookStoreBlazorModule : AbpModule ConfigureAuthentication(context); ConfigureUrls(configuration); ConfigureBundles(); - ConfigureAutoMapper(); + ConfigureMapperly(context); ConfigureVirtualFileSystem(hostingEnvironment); ConfigureSwaggerServices(context.Services); ConfigureAutoApiControllers(); @@ -273,12 +274,9 @@ public class BookStoreBlazorModule : AbpModule }); } - private void ConfigureAutoMapper() + private void ConfigureMapperly(ServiceConfigurationContext context) { - Configure(options => - { - options.AddMaps(); - }); + context.Services.AddMapperlyObjectMapper(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/samples/WebAppBlazorServer/src/BookStore.Application/BookStore.Application.csproj b/samples/WebAppBlazorServer/src/BookStore.Application/BookStore.Application.csproj index af908bb..69916c3 100644 --- a/samples/WebAppBlazorServer/src/BookStore.Application/BookStore.Application.csproj +++ b/samples/WebAppBlazorServer/src/BookStore.Application/BookStore.Application.csproj @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs b/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs deleted file mode 100644 index 8c6108c..0000000 --- a/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoMapper; - -namespace BookStore; - -public class BookStoreApplicationAutoMapperProfile : Profile -{ - public BookStoreApplicationAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - } -} diff --git a/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationMappers.cs b/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationMappers.cs new file mode 100644 index 0000000..af509dc --- /dev/null +++ b/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationMappers.cs @@ -0,0 +1,13 @@ +using System; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace BookStore; + +[Mapper] +public partial class BookStoreApplicationMapper +{ + + + +} diff --git a/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationModule.cs b/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationModule.cs index 2c58633..bb22087 100644 --- a/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationModule.cs +++ b/samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationModule.cs @@ -2,10 +2,11 @@ using Volo.Abp.SettingManagement; using Volo.Abp.Account; using Volo.Abp.Identity; -using Volo.Abp.AutoMapper; using Volo.Abp.FeatureManagement; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.TenantManagement; +using Microsoft.Extensions.DependencyInjection; namespace BookStore; @@ -18,15 +19,12 @@ namespace BookStore; typeof(AbpAccountApplicationModule), typeof(AbpTenantManagementApplicationModule), typeof(AbpSettingManagementApplicationModule), - typeof(AbpAutoMapperModule) + typeof(AbpMapperlyModule) )] public class BookStoreApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { - Configure(options => - { - options.AddMaps(); - }); + context.Services.AddMapperlyObjectMapper(); } } diff --git a/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorApplicationMappers.cs b/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorApplicationMappers.cs new file mode 100644 index 0000000..2a69123 --- /dev/null +++ b/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorApplicationMappers.cs @@ -0,0 +1,13 @@ +using System; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace BookStore; + +[Mapper] +public partial class BookStoreBlazorMapper +{ + + + +} diff --git a/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs b/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs deleted file mode 100644 index 140ddf6..0000000 --- a/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs +++ /dev/null @@ -1,11 +0,0 @@ -using AutoMapper; - -namespace BookStore.Blazor; - -public class BookStoreBlazorAutoMapperProfile : Profile -{ - public BookStoreBlazorAutoMapperProfile() - { - //Define your AutoMapper configuration here for the Blazor project. - } -} diff --git a/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorModule.cs b/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorModule.cs index b0e713b..1492a18 100644 --- a/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorModule.cs +++ b/samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorModule.cs @@ -34,13 +34,13 @@ using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling; using Volo.Abp.Identity; using Volo.Abp.Autofac; -using Volo.Abp.AutoMapper; using Lsw.Abp.IdentityManagement.Blazor.Server.AntDesignUI; using Lsw.Abp.TenantManagement.Blazor.Server.AntDesignUI; using Lsw.Abp.SettingManagement.Blazor.Server.AntDesignUI; using Lsw.Abp.FeatureManagement.Blazor.Server.AntDesignUI; using Volo.Abp.Security.Claims; using Volo.Abp.Localization; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.OpenIddict; using Volo.Abp.Swashbuckle; @@ -65,7 +65,8 @@ namespace BookStore.Blazor; typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule), typeof(AbpAspNetCoreSerilogModule), typeof(AbpFeatureManagementBlazorServerAntDesignModule), - typeof(AbpSettingManagementBlazorServerAntDesignModule) + typeof(AbpSettingManagementBlazorServerAntDesignModule), + typeof(AbpMapperlyModule) )] public class BookStoreBlazorModule : AbpModule { @@ -147,7 +148,7 @@ public class BookStoreBlazorModule : AbpModule ConfigureAuthentication(context); ConfigureUrls(configuration); ConfigureBundles(); - ConfigureAutoMapper(); + ConfigureMapperly(context); ConfigureVirtualFileSystem(hostingEnvironment); ConfigureSwaggerServices(context.Services); ConfigureAutoApiControllers(); @@ -266,12 +267,9 @@ public class BookStoreBlazorModule : AbpModule }); } - private void ConfigureAutoMapper() + private void ConfigureMapperly(ServiceConfigurationContext context) { - Configure(options => - { - options.AddMaps(); - }); + context.Services.AddMapperlyObjectMapper(); } public override void OnApplicationInitialization(ApplicationInitializationContext context) diff --git a/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStore.Application.csproj b/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStore.Application.csproj index af908bb..69916c3 100644 --- a/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStore.Application.csproj +++ b/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStore.Application.csproj @@ -1,4 +1,4 @@ - + @@ -14,7 +14,7 @@ - + diff --git a/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationApplicationMappers.cs b/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationApplicationMappers.cs new file mode 100644 index 0000000..af509dc --- /dev/null +++ b/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationApplicationMappers.cs @@ -0,0 +1,13 @@ +using System; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace BookStore; + +[Mapper] +public partial class BookStoreApplicationMapper +{ + + + +} diff --git a/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs b/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs deleted file mode 100644 index 8c6108c..0000000 --- a/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AutoMapper; - -namespace BookStore; - -public class BookStoreApplicationAutoMapperProfile : Profile -{ - public BookStoreApplicationAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - } -} diff --git a/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationModule.cs b/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationModule.cs index 2c58633..bb22087 100644 --- a/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationModule.cs +++ b/samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationModule.cs @@ -2,10 +2,11 @@ using Volo.Abp.SettingManagement; using Volo.Abp.Account; using Volo.Abp.Identity; -using Volo.Abp.AutoMapper; using Volo.Abp.FeatureManagement; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.TenantManagement; +using Microsoft.Extensions.DependencyInjection; namespace BookStore; @@ -18,15 +19,12 @@ namespace BookStore; typeof(AbpAccountApplicationModule), typeof(AbpTenantManagementApplicationModule), typeof(AbpSettingManagementApplicationModule), - typeof(AbpAutoMapperModule) + typeof(AbpMapperlyModule) )] public class BookStoreApplicationModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { - Configure(options => - { - options.AddMaps(); - }); + context.Services.AddMapperlyObjectMapper(); } } diff --git a/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs b/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs deleted file mode 100644 index 058f1fb..0000000 --- a/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs +++ /dev/null @@ -1,11 +0,0 @@ -using AutoMapper; - -namespace BookStore.Blazor.Client; - -public class BookStoreBlazorAutoMapperProfile : Profile -{ - public BookStoreBlazorAutoMapperProfile() - { - //Define your AutoMapper configuration here for the Blazor project. - } -} \ No newline at end of file diff --git a/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs b/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs index c0f0e94..f4add7b 100644 --- a/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs +++ b/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs @@ -15,7 +15,7 @@ using Lsw.Abp.SettingManagement.Blazor.WebAssembly.AntDesignUI; using Lsw.Abp.TenantManagement.Blazor.WebAssembly.AntDesignUI; using OpenIddict.Abstractions; using Volo.Abp.Autofac.WebAssembly; -using Volo.Abp.AutoMapper; +using Volo.Abp.Mapperly; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; @@ -28,6 +28,7 @@ namespace BookStore.Blazor.Client; typeof(AbpFeatureManagementBlazorWebAssemblyAntDesignModule), typeof(AbpTenantManagementBlazorWebAssemblyAntDesignModule), typeof(AbpAspNetCoreComponentsWebAssemblyAntDesignThemeModule), + typeof(AbpMapperlyModule), typeof(BookStoreHttpApiClientModule) )] public class BookStoreBlazorClientModule : AbpModule @@ -43,7 +44,7 @@ public class BookStoreBlazorClientModule : AbpModule //ConfigureBlazorise(context); ConfigureRouter(context); ConfigureMenu(context); - ConfigureAutoMapper(context); + ConfigureMapperly(context); } private void ConfigureLocalization() @@ -102,11 +103,8 @@ public class BookStoreBlazorClientModule : AbpModule }); } - private void ConfigureAutoMapper(ServiceConfigurationContext context) + private void ConfigureMapperly(ServiceConfigurationContext context) { - Configure(options => - { - options.AddMaps(); - }); + context.Services.AddMapperlyObjectMapper(); } } diff --git a/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs b/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs new file mode 100644 index 0000000..9cf054f --- /dev/null +++ b/samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs @@ -0,0 +1,13 @@ +using System; +using Riok.Mapperly.Abstractions; +using Volo.Abp.Mapperly; + +namespace BookStore; + +[Mapper] +public partial class BookStoreBlazorClientMapper +{ + + + +}