Local (mapping method level) for AllowNullPropertyAssignment
xontab opened this issue · comments
Is your feature request related to a problem? Please describe.
It looks like at the moment AllowNullPropertyAssignment
is only accepted at Global (mapper level). Thus multiple mapper classes need to be created if AllowNullPropertyAssignment
is only required for one mapping method.
Describe the solution you'd like
If possible a MapperAllowNullPropertyAssignment
attribute can be introduced to allow adding this attribute at method level. This approach is similar to other configuration such as RequiredMappingStrategy
.
[MapperAllowNullPropertyAssignment(false)]
public partial void MapCar(this Car source, CarDto target);
Additional context
If there are technical challenges to achieve this, the current solution of implementing multiple classes is still good enough.