AutoMapper: What is the difference between MapFrom and ResolveUsing?

后端 未结 5 1897
执笔经年
执笔经年 2020-11-30 07:00

Ignoring the ResolveUsing overloads that take an IValueResolver, and looking only at these 2 methods:

v         


        
5条回答
  •  盖世英雄少女心
    2020-11-30 07:42

    MapFrom has a few extra smarts. For example (from the mailing list):

    In MapFrom, I try to be smart about digging in to child properties (much like the normal flattening does). MapFrom is an attempt to mimic flattening, with an added bit of allowing redirection. ResolveUsing doesn't have this behavior.

    I'm not sure if this is fully documented anywhere (apart from in the source code).

提交回复
热议问题