Getting an exception with AutoMapper

前端 未结 2 1604
孤独总比滥情好
孤独总比滥情好 2021-01-04 03:48

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

2条回答
  •  青春惊慌失措
    2021-01-04 04:28

    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(obj);
    }
    
    public static DJBL_tblCustomerCurrentLedger ToEntity(this CustomerLedgerViewModel model)
    {
        return Mapper.Map(model);
    } 
    

提交回复
热议问题