Enum definition is
public enum RowStatusEnum
{
Modified = 1,
Removed = 2,
Added = 3
}
public class RowStatusEnumConvertor : IMapperConfigurator
{
public void Cofigure()
{
Mapper.CreateMap<RowStatusEnum, byte>();
Mapper.CreateMap<byte, RowStatusEnum >();
}
}
I config autoMapper with Implemention IMapperConfigurator in RowStatusEnumConvertor class, but not work this code and not map this type, i think my config not correct or not enough, please help me
thanks
I have reproduced your problem. The solution is pretty simple, don't configure AutoMapper and set the base type of the enum to byte. Like this:
To let it work:
Will something like this work for you?
Classes.cs
AutoMapperConfigurator.cs
MappingTests.cs