c# - Unable to Map Registration to RegistrationDTO -


i tried mapping registrationdto registration using following code worked fine.

mapper.createmap<registrationdto, registration>()             .formember(dest => dest.address, o => o.mapfrom(s => s.address != null ? s.address : s.address))             .formember(dest => dest.businessentityaddress, src => src.mapfrom(s => s.businessentityaddress != null ? s.businessentityaddress : s.businessentityaddress)); mapper.createmap<addressdto, address>(); 

and mapper code is,

registration userdetails = mapper.map<registrationdto, registration>(user); 

now inorder convert registrationdto registration used below code

mapper.createmap<registration, registrationdto>()            .formember(dest => dest.address, o => o.mapfrom(s => s.address != null ? s.address : s.address))            .formember(dest => dest.businessentityaddress, src => src.mapfrom(s => s.businessentityaddress != null ? s.businessentityaddress : s.businessentityaddress)); mapper.createmap<address, addressdto>(); 

and respective mapping code is

registrationdto userregdto = mapper.map<registration,registrationdto>(userreg); 

now when run code, there's exception says "automappermapping excpetion caught." near,

registrationdto userregdto = mapper.map<registration,registrationdto>(userreg); 

is there missing map? please me out this?


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -