Quantcast
Channel: CSharp Forum Latest Questions
Viewing all articles
Browse latest Browse all 32058

AutoMapperMappingException' was thrown.

$
0
0
Hi,

I'm working on one of application. I'm trying to map my viewmodel to my model. In one of my controller I have the mapping :

if



(validCompany)


            {



IEnumerable<Models.HCCompany> HealthCanadaCompanyList = Mapper.Map<IEnumerable<ViewModels.CompanyWrapper>, IEnumerable<Models.HCCompany>>(healthCanadaCompany.Companys);


               


if (!this.service.AddHealthCanadaCompany(HealthCanadaCompanyList))


                {


                   


StatusBar.SetMessage(MessageType.Error, Resources.DataImport.HealthCanadaUploadError);


                }


            }


When I run the the application, it gives me the error messages:

Trying to map System.Collections.Generic.IEnumerable`1[[Cims.UI.Web.DataImport.ViewModels.CompanyWrapper, Cims.UI.Web, Version=0.2.0.0, Culture=neutral, PublicKeyToken=891ddfffc2a12a6a]] to System.Collections.Generic.IEnumerable`1[[Cims.Data.Models.HCCompany, Cims.Data.Models, Version=0.2.0.0, Culture=neutral, PublicKeyToken=891ddfffc2a12a6a]].
Exception of type 'AutoMapper.AutoMapperMappingException' was thrown.

Does any body has any idea how to debug this errors ? Any more details please let me know.

Thanks
 

Viewing all articles
Browse latest Browse all 32058

Trending Articles