File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,19 @@ by the mapper whenever the configured type pair is matched:
2222``` csharp
2323Mapper .WhenMapping
2424 .From <Address >().To <AddressDto >()
25- .MapInstancesUsing (( a , dto ) => new AddressDto
25+ .MapInstancesUsing (ctx => new AddressDto
2626 {
27- Number = a .HouseNo ,
28- Line1 = a .Street ,
29- Line2 = a .Town ,
30- Line3 = a .City ,
31- Line4 = a .County ,
32- Postcode = a .PostalCode
27+ Number = ctx . Source .HouseNo ,
28+ Line1 = ctx . Source .Street ,
29+ Line2 = ctx . Source .Town ,
30+ Line3 = ctx . Source .City ,
31+ Line4 = ctx . Source .County ,
32+ Postcode = ctx . Source .PostalCode
3333 });
3434```
3535
36+ See a live example on [ DotNetFiddle] ( https://dotnetfiddle.net/XNPrMS ) {: target ="_ blank"}.
37+
3638## Alternate Data Sources
3739
3840To map from a data source other than a source model's matching member, an alternate source can be
You can’t perform that action at this time.
0 commit comments