开发者

AutoMapper Exclude Fields

开发者 https://www.devze.com 2023-01-05 00:44 出处:网络
I\'m trying to map one object to another but the object is quite complex. During development, I\'d like the ability to either exclude a bunch of fields and get to them one by one or be able to specify

I'm trying to map one object to another but the object is quite complex. During development, I'd like the ability to either exclude a bunch of fields and get to them one by one or be able to specify to map only field开发者_开发问答s I want and increase that as each test succeeds.

So:

class    
    string field1    
    string field2    
    string field3

Now I'd like to map field1, test, fix and then move onto field2 then field3.

Is this possible?


.ForMember(dto => dto.field1, opt => opt.Ignore());
0

精彩评论

暂无评论...
验证码 换一张
取 消