Automapper : partial mapping

后端 未结 1 975
遥遥无期
遥遥无期 2020-12-17 15:48

I am using Automapper to transfer data from objectA to objectB

classe ObjectA
{
   string Title;
   string Summary;
}

classe ObjectB
{
   string Title;
   s         


        
相关标签:
1条回答
  • 2020-12-17 16:26

    I found the solution.

    I just discovered that Map method has an overloaded version that excepts a pre-instantiated destination object. Thanks to this article

    Mapper.Map<IObjectA, IObjectB>(objectA, ObjectB ); 
    

    @JoDG, Thank you for your help

    0 讨论(0)
提交回复
热议问题