Skip to content

Instantly share code, notes, and snippets.

@detroitpro
Created April 12, 2010 16:28
Show Gist options
  • Save detroitpro/363750 to your computer and use it in GitHub Desktop.
Save detroitpro/363750 to your computer and use it in GitHub Desktop.
public static void RunSnippet()
{
Mapper.CreateMap<FirstClass,SecondClass>();
Mapper.CreateMap<FirstEnum,SecondEnum>();
var firstClass = new FirstClass();
firstClass.EnumValue = FirstEnum.NamedEnum;
Mapper.Map<FirstClass,SecondClass>(firstClass);
}
public class FirstClass
{
FirstEnum EnumValue {get;set;}
}
public enum FirstEnum
{
NamedEnum = 1,
SecondNameEnum = 2
}
public class SecondClass
{
SecondEnum EnumValue {get;set;}
}
public enum SecondEnum
{
DifferentNamedEnum = 1,
SecondNameEnum = 2
}
@detroitpro
Copy link
Author

The expected output is that

SecondClass.EnumValue = SecondEnum.DifferentNamedEnum;

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