Created
October 30, 2015 09:32
-
-
Save lbargaoanu/fbfabe9f5fdba6703374 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
Mapper.CreateMap<Source, DestinationBase>().ForAllMembers(e => e.Ignore()); | |
Mapper.CreateMap<Source, Destination>().IncludeBase<Source, DestinationBase>(); | |
Mapper.Configuration.Seal(); | |
Mapper.AssertConfigurationIsValid(); | |
Mapper.Map<Destination>(new Source { Value = 3 }).Dump(); | |
} | |
public class DestinationBase | |
{ | |
public int AnotherValue { get; set; } | |
} | |
public class Destination : DestinationBase | |
{ | |
public int Value { get;set; } | |
} | |
public class Source | |
{ | |
public int Value { get; set; } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment