From 32febf53184d8128678aee796b8e928f316c8fe4 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Thu, 19 Feb 2026 15:36:01 +0300 Subject: [PATCH] Update post.md --- .../post.md | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/en/Community-Articles/2026-02-19-ABP-Framework-Hidden-Magic/post.md b/docs/en/Community-Articles/2026-02-19-ABP-Framework-Hidden-Magic/post.md index 366c186f4d..9883ca9aba 100644 --- a/docs/en/Community-Articles/2026-02-19-ABP-Framework-Hidden-Magic/post.md +++ b/docs/en/Community-Articles/2026-02-19-ABP-Framework-Hidden-Magic/post.md @@ -133,15 +133,22 @@ using (_dataFilter.Disable()) ## 8. Object Mapping (Mapperly - The New Standard) -**The Magic:** ABP now uses **Mapperly** instead of AutoMapper in new project templates. Any class using Mapperly attributes is automatically configured. +**The Magic:** Starting with **ABP v9.0**, new project templates use **Mapperly** instead of AutoMapper. Any class using Mapperly attributes is automatically configured. ```csharp -// New ABP projects use Mapperly instead of AutoMapper -[MapperGenerator] -public partial class MyMapper : MapperBase +// Starting with ABP v9.0, new projects use Mapperly instead of AutoMapper + +// Inherit from MapperBase - automatically registered with IObjectMapper +public partial class UserMapper : MapperBase { - public partial UserDto MapToDto(User user); - public partial User MapToEntity(UserDto dto); + public override partial UserDto Map(User source); +} + +// For two-way mapping +public partial class UserTwoWayMapper : TwoWayMapperBase +{ + public override partial UserDto Map(User source); + public override partial User ReverseMap(UserDto source); } ``` @@ -160,8 +167,6 @@ context.Services.OnRegistered(context => }); ``` -**Migration Note:** If you're on an older project using AutoMapper, you can manually add `Volo.Abp.AutoMapper` package and configure it. However, new templates come with Mapperly out of the box. - --- ## 9. Automatic Data Seed Contributor Discovery @@ -546,7 +551,7 @@ No configuration needed beyond the package reference! | 6 | **Security Log** | Always on | Can configure what to log | | 7 | **Soft Delete Filter** | Enabled by default | Must disable to query deleted | | 8 | **Multi-Tenancy Filter** | Enabled by default | Must disable for host data | -| 9 | **Object Mapping** | Mapperly (compile-time) | Use `[MapperGenerator]` attribute | +| 9 | **Object Mapping** | Mapperly (compile-time) | Inherit from `MapperBase` | | 10 | **Data Seeds** | Auto-discovery | Implement `IDataSeedContributor` | | 11 | **Remote Services** | Enabled by default | Can disable per service/method | | 12 | **Auto API Controllers** | App services → REST APIs | No manual controller needed |