Getting an exception with AutoMapper

半世苍凉 提交于 2019-11-30 17:28:52

It appears you are specifying the wrong type on your call to Mapper.CreateMap

Try doing something like the following:

Mapper.CreateMap<SupplierEligibilityTransactionByQuantity, SupplierEligibilityAllocated>()
atik sarker

If any one using Mapper.Map() check your mapping class & table/store procedure properly.

public static CustomerLedgerViewModel ToModel(this DJBL_tblCustomerCurrentLedger obj)
{
    return Mapper.Map<DJBL_tblCustomerCurrentLedger, CustomerLedgerViewModel>(obj);
}

public static DJBL_tblCustomerCurrentLedger ToEntity(this CustomerLedgerViewModel model)
{
    return Mapper.Map<CustomerLedgerViewModel, DJBL_tblCustomerCurrentLedger>(model);
} 
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!