-
Notifications
You must be signed in to change notification settings - Fork 171
Description
Title
CRUD CodeGeneration fails with Mapperly: missing mapping AbpHelperGenerateCrudInput -> CrudCommandOption
Description
When running CRUD code generation in ABP Helper GUI, the operation fails with an ABP/Mapperly exception indicating that no object mapping exists for the DTO-to-command mapping.
The crash happens when the GUI layer maps the input DTO to the Core command option via ObjectMapper.Map<,>.
Exception
Volo.Abp.AbpException: No object mapping was found for the specified source and destination types.
Mapping attempted: AbpHelperGenerateCrudInput -> CrudCommandOption EasyAbp.AbpHelper.Gui.CodeGeneration.Crud.Dtos.AbpHelperGenerateCrudInput -> EasyAbp.AbpHelper.Core.Commands.Generate.Crud.CrudCommandOption
(Stack trace points to ObjectMapper.Map<AbpHelperGenerateCrudInput, CrudCommandOption>(input) in the CRUD generation app service.)
Expected behavior
CRUD generation should work without requiring consumer projects to add custom object mapping configuration for ABP Helper’s own DTOs/options.
Actual behavior
Generation fails at runtime because the mapping pair is not defined/registered for Mapperly.
Root cause (likely)
With ABP’s Mapperly integration, mappings are not implicit. ABP Helper GUI calls ObjectMapper.Map<,> but does not provide a Mapperly mapper (e.g., MapperBase<TSource, TDestination>) for this DTO → option mapping.
Workarounds
- Manually map
AbpHelperGenerateCrudInputintoCrudCommandOption(avoidObjectMapper.Map). - Add a Mapperly mapper in the GUI application (requires adding
Volo.Abp.Mapperlypackage references).
Suggested fix
Ship a built-in mapping for:
AbpHelperGenerateCrudInput→CrudCommandOption
Options:
- Replace the
ObjectMapper.Mapcall with explicit/manual mapping inside ABP Helper. - Or add a Mapperly mapper (
MapperBase<,>) in the correct assembly/module so it’s discovered and registered automatically.