-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New object is created on destination instead of null when using Adapt<> #693
Comments
I migrated from AutoMapper, and there I had the "AllowNullDestinationValues" property on the MapperConfiguration. |
A little too late to the party but I just hit the same problem. config.NewConfig<ProductCategory, SaveProductCategoryDto>()
.MaxDepth(1);
config.NewConfig<SaveProductCategoryDto, ProductCategory>()
.IgnoreMember((member, side) => side == MemberSide.Destination
&& member.Name.Equals(nameof(ProductCategory.Company)))
.IgnoreNullValues(true)
.MaxDepth(1); where Best, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the following classes:
ScheduleWrapper
Schedule
When I try to adapt ScheduleWrapper to Schedule, on Schedule an empty Company object will be created instead of null.
Other configurations are:
I noticed this behavior also in other places where the explicit mapping is not defined.
Is there a setting to not create empty objects on destination when it not exists on source?
The text was updated successfully, but these errors were encountered: