I\'m unit testing a method which uses automapper to map a class from my domain to a linq to sql class. Roughly, the classes and mapping are below (The SupplierEligibilityAl
It appears you are specifying the wrong type on your call to Mapper.CreateMap
Try doing something like the following:
Mapper.CreateMap<SupplierEligibilityTransactionByQuantity, SupplierEligibilityAllocated>()
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);
}