I have gone through Google and some of the post here on SO but I am not able to understand why my Automapper setup maps some classes where as not others. I am using .net core 3.1 and AutoMapper 10.0.0
Below is my implementation
FactoryOLTPSystemsEntity : entity class
FactoryOLTPSystems :Domain Class(DTO)
These classes are essentially the same with same properties and there is no change except that they belong to different Namespace.
Service Registration services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies());
My Mapping class
//This works perfectly fine
CreateMap<Routes, RoutesEntity>()
.ForMember(dest => dest.integration_id,
opt => opt.MapFrom(src => Convert.ToString(src.route_id)))
.ForMember(dest => dest.line_no,
opt => opt.MapFrom(src => int.Parse(src.dos_line_no.ToString())))
.ForMember(dest => dest.sub_part_import_src,
opt => opt.MapFrom(src => double.Parse(src.subimport_path)))
.ForMember(dest => dest.dgs_server_id,
opt => opt.Ignore());
//This doesnt
CreateMap<FactoryOLTPSystemsEntity, FactoryOLTPSystems>().ReverseMap();
This is the error I get
Missing type map configuration or unsupported mapping.
Mapping types:
Object -> FactoryOLTPSystems
System.Object -> NameSpace.FactoryOLTPSystems
I not sure if I am missing something. Any help would be appreciated ..Cheers!!