Map collection of objects

后端 未结 2 1606
再見小時候
再見小時候 2020-12-16 09:37

I am trying to introduce Automapper into an application for the first time, but I keep getting an error saying I have some invalid arguments.

My model:



        
2条回答
  •  北荒
    北荒 (楼主)
    2020-12-16 09:53

    You are mapping collections, not single entities (IEnumerable to IEnumerable), so use this mapping

    var VMstores = Mapper.Map, IEnumerable>(stores);
    

提交回复
热议问题