Browse Source

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.
pull/43/head
liangshiwei 2 weeks ago
parent
commit
1a45faf54c
  1. 2
      Directory.Packages.props
  2. 2
      common.props
  3. 4
      modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/AbpFeatureManagementBlazorAntDesignModule.cs
  4. 2
      modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI.csproj
  5. 27
      modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignApplicationMappers.cs
  6. 19
      modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignAutoMapperProfile.cs
  7. 11
      modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignModule.cs
  8. 2
      modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI.csproj
  9. 4
      modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/AbpPermissionManagementBlazorAntDesignModule.cs
  10. 2
      modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI.csproj
  11. 12
      modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/AbpSettingManagementBlazorAntDesignModule.cs
  12. 2
      modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/Lsw.Abp.SettingManagement.Blazor.AntDesignUI.csproj
  13. 13
      modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorApplicationMappers.cs
  14. 12
      modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorAutoMapperProfile.cs
  15. 11
      modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAntDesignModule.cs
  16. 14
      modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorApplicationMappers.cs
  17. 13
      modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAutoMapperProfile.cs
  18. 2
      modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/Lsw.Abp.TenantManagement.Blazor.AntDesignUI.csproj
  19. 1
      nuget/0
  20. 4
      samples/WebApp/src/BookStore.Application/BookStore.Application.csproj
  21. 13
      samples/WebApp/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs
  22. 13
      samples/WebApp/src/BookStore.Application/BookStoreApplicationMappers.cs
  23. 10
      samples/WebApp/src/BookStore.Application/BookStoreApplicationModule.cs
  24. 11
      samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs
  25. 12
      samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs
  26. 13
      samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs
  27. 11
      samples/WebApp/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs
  28. 13
      samples/WebApp/src/BookStore.Blazor/BookStoreBlazorMappers.cs
  29. 14
      samples/WebApp/src/BookStore.Blazor/BookStoreBlazorModule.cs
  30. 4
      samples/WebAppBlazorServer/src/BookStore.Application/BookStore.Application.csproj
  31. 13
      samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs
  32. 13
      samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationMappers.cs
  33. 10
      samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationModule.cs
  34. 13
      samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorApplicationMappers.cs
  35. 11
      samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs
  36. 14
      samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorModule.cs
  37. 4
      samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStore.Application.csproj
  38. 13
      samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationApplicationMappers.cs
  39. 13
      samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs
  40. 10
      samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationModule.cs
  41. 11
      samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs
  42. 12
      samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorClientModule.cs
  43. 13
      samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorMappers.cs

2
Directory.Packages.props

@ -26,7 +26,7 @@
<PackageVersion Include="Volo.Abp.Authorization" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Autofac" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Autofac.WebAssembly" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Mapperly" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.BackgroundJobs.Abstractions" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.BackgroundJobs.Domain.Shared" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.BackgroundJobs.EntityFrameworkCore" Version="$(VoloAbpPackageVersion)" />

2
common.props

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>0.9.9.1</Version>
<Version>0.9.9.2</Version>
<PackageIconUrl>https://raw.githubusercontent.com/realliangshiwei/Lsw.Abp.AntDesignUI/main/icon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/realLiangshiwei/Lsw.Abp.AntDesignUI</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

4
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)
)]

2
modules/FeatureManagement/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI/Lsw.Abp.FeatureManagement.Blazor.AntDesignUI.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.Features" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application.Contracts" />
</ItemGroup>

27
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<IdentityUserDto, IdentityUserUpdateDto>
{
[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<IdentityRoleDto, IdentityRoleUpdateDto>
{
public override partial IdentityRoleUpdateDto Map(IdentityRoleDto source);
public override partial void Map(IdentityRoleDto source, IdentityRoleUpdateDto destination);
}

19
modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/AbpIdentityBlazorAntDesignAutoMapperProfile.cs

@ -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<IdentityUserDto, IdentityUserUpdateDto>()
.MapExtraProperties()
.Ignore(x => x.Password)
.Ignore(x => x.RoleNames);
CreateMap<IdentityRoleDto, IdentityRoleUpdateDto>()
.MapExtraProperties();
}
}

11
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<AbpIdentityBlazorAntDesignModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpIdentityBlazorAntDesignAutoMapperProfile>(validate: true);
});
context.Services.AddMapperlyObjectMapper<AbpIdentityBlazorAntDesignModule>();
Configure<AbpNavigationOptions>(options =>
{

2
modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.Identity.Application.Contracts"/>
</ItemGroup>

4
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

2
modules/PermissionManagement/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI/Lsw.Abp.PermissionManagement.Blazor.AntDesignUI.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" />
</ItemGroup>

12
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<AbpSettingManagementBlazorAntDesignModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<SettingManagementBlazorAutoMapperProfile>(validate: true);
});
context.Services.AddMapperlyObjectMapper<AbpSettingManagementBlazorAntDesignModule>();
Configure<AbpNavigationOptions>(options =>
{

2
modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/Lsw.Abp.SettingManagement.Blazor.AntDesignUI.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.SettingManagement.Application.Contracts" />
</ItemGroup>

13
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<EmailSettingsDto, UpdateEmailSettingsDto>
{
public override partial UpdateEmailSettingsDto Map(EmailSettingsDto source);
public override partial void Map(EmailSettingsDto source, UpdateEmailSettingsDto destination);
}

12
modules/SettingManagement/Lsw.Abp.SettingManagement.Blazor.AntDesignUI/SettingManagementBlazorAutoMapperProfile.cs

@ -1,12 +0,0 @@
using AutoMapper;
using Volo.Abp.SettingManagement;
namespace Lsw.Abp.SettingManagement.Blazor.AntDesignUI;
public class SettingManagementBlazorAutoMapperProfile : Profile
{
public SettingManagementBlazorAutoMapperProfile()
{
CreateMap<EmailSettingsDto, UpdateEmailSettingsDto>();
}
}

11
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<AbpTenantManagementBlazorAntDesignModule>();
Configure<AbpAutoMapperOptions>(options =>
{
options.AddProfile<AbpTenantManagementBlazorAutoMapperProfile>(validate: true);
});
context.Services.AddMapperlyObjectMapper<AbpTenantManagementBlazorAntDesignModule>();
Configure<AbpNavigationOptions>(options =>
{

14
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<TenantDto, TenantUpdateDto>
{
public override partial TenantUpdateDto Map(TenantDto source);
public override partial void Map(TenantDto source, TenantUpdateDto destination);
}

13
modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/AbpTenantManagementBlazorAutoMapperProfile.cs

@ -1,13 +0,0 @@
using AutoMapper;
using Volo.Abp.TenantManagement;
namespace Lsw.Abp.TenantManagement.Blazor.AntDesignUI;
public class AbpTenantManagementBlazorAutoMapperProfile : Profile
{
public AbpTenantManagementBlazorAutoMapperProfile()
{
CreateMap<TenantDto, TenantUpdateDto>()
.MapExtraProperties();
}
}

2
modules/TenantManagement/Lsw.Abp.TenantManagement.Blazor.AntDesignUI/Lsw.Abp.TenantManagement.Blazor.AntDesignUI.csproj

@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.TenantManagement.Application.Contracts" />
</ItemGroup>

1
nuget/0

@ -1 +0,0 @@
0

4
samples/WebApp/src/BookStore.Application/BookStore.Application.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" />
<PackageReference Include="Volo.Abp.SettingManagement.Application" />

13
samples/WebApp/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs

@ -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. */
}
}

13
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
{
}

10
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<AbpAutoMapperOptions>(options =>
{
options.AddMaps<BookStoreApplicationModule>();
});
context.Services.AddMapperlyObjectMapper<BookStoreApplicationModule>();
}
}

11
samples/WebApp/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs

@ -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.
}
}

12
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<AbpAutoMapperOptions>(options =>
{
options.AddMaps<BookStoreBlazorClientModule>();
});
context.Services.AddMapperlyObjectMapper<BookStoreBlazorClientModule>();
}
}

13
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
{
}

11
samples/WebApp/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs

@ -1,11 +0,0 @@
using AutoMapper;
namespace BookStore.Blazor;
public class BookStoreBlazorAutoMapperProfile : Profile
{
public BookStoreBlazorAutoMapperProfile()
{
//Define your AutoMapper configuration here for the Blazor project.
}
}

13
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
{
}

14
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<AbpAutoMapperOptions>(options =>
{
options.AddMaps<BookStoreBlazorModule>();
});
context.Services.AddMapperlyObjectMapper<BookStoreBlazorModule>();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

4
samples/WebAppBlazorServer/src/BookStore.Application/BookStore.Application.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" />
<PackageReference Include="Volo.Abp.SettingManagement.Application" />

13
samples/WebAppBlazorServer/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs

@ -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. */
}
}

13
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
{
}

10
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<AbpAutoMapperOptions>(options =>
{
options.AddMaps<BookStoreApplicationModule>();
});
context.Services.AddMapperlyObjectMapper<BookStoreApplicationModule>();
}
}

13
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
{
}

11
samples/WebAppBlazorServer/src/BookStore.Blazor/BookStoreBlazorAutoMapperProfile.cs

@ -1,11 +0,0 @@
using AutoMapper;
namespace BookStore.Blazor;
public class BookStoreBlazorAutoMapperProfile : Profile
{
public BookStoreBlazorAutoMapperProfile()
{
//Define your AutoMapper configuration here for the Blazor project.
}
}

14
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<AbpAutoMapperOptions>(options =>
{
options.AddMaps<BookStoreBlazorModule>();
});
context.Services.AddMapperlyObjectMapper<BookStoreBlazorModule>();
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

4
samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStore.Application.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
@ -14,7 +14,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AutoMapper" />
<PackageReference Include="Volo.Abp.Mapperly" />
<PackageReference Include="Volo.Abp.PermissionManagement.Application" />
<PackageReference Include="Volo.Abp.FeatureManagement.Application" />
<PackageReference Include="Volo.Abp.SettingManagement.Application" />

13
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
{
}

13
samples/WebAppBlazorWebAssembly/src/BookStore.Application/BookStoreApplicationAutoMapperProfile.cs

@ -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. */
}
}

10
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<AbpAutoMapperOptions>(options =>
{
options.AddMaps<BookStoreApplicationModule>();
});
context.Services.AddMapperlyObjectMapper<BookStoreApplicationModule>();
}
}

11
samples/WebAppBlazorWebAssembly/src/BookStore.Blazor.Client/BookStoreBlazorAutoMapperProfile.cs

@ -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.
}
}

12
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<AbpAutoMapperOptions>(options =>
{
options.AddMaps<BookStoreBlazorClientModule>();
});
context.Services.AddMapperlyObjectMapper<BookStoreBlazorClientModule>();
}
}

13
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
{
}
Loading…
Cancel
Save