Mapping from list down to object with AutoMapper

前端 未结 1 668
南方客
南方客 2020-12-17 02:15

I\'m new with AutoMapper and have a problem I\'m trying to solve.

If I have a source class like this:

public c         


        
相关标签:
1条回答
  • 2020-12-17 02:52

    You'll want to use the Custom Value Resolvers feature of AutoMapper. So you'd setup a Custom Resolver to map from your list to your single entity using the IsPreferredAddress flag to find it.

    The documentation is pretty good for the Custom Resolvers so you should be fine figuring it out from there.

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