Skip to content

10.1.0 Fix and Improvements - #1006

Merged
DocSvartz merged 14 commits into
MapsterMapper:v10.1.0from
DocSvartz:10.1.---feat-null-propagation
Aug 10, 2026
Merged

10.1.0 Fix and Improvements#1006
DocSvartz merged 14 commits into
MapsterMapper:v10.1.0from
DocSvartz:10.1.---feat-null-propagation

Conversation

@DocSvartz

Copy link
Copy Markdown
Contributor

Fix:

  • added support DefaultValue() from constructor mapping;
  • added support MapUsing() from ExtraSource/Flattening mapping.

Improvements:

  • NullablePropagation improvements;
  • added ReMap() setting setter - Map() for Ignored member and an additional option to skip the application of Destination Transforms
config.Default.AddDestinationTransform(DestinationTransform.EmptyCollectionIfNull);
            config.ForDestinationType<DestinationFlattentData>()
                .Ignore(x => x.Value);
            config.NewConfig<SourceFlattentInsaider, DestinationFlattentData>()
                .ReMap(dest => dest, src => src.SrcData, true); 

 var result = src.Adapt<DestinationFlattentData>(config);

            result.Collection.ShouldBeNull(); // all member from ExtraSource - SrcData  has skip DestinationTransform.EmptyCollectionIfNull 
            result.Value.ShouldBe("Hello"); // property Value has value from ExtraSource - SrcData

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mapster throws ArgumentNullException when mapping null collection property with LINQ method (Select), unlike AutoMapper

1 participant