AutoMapper Exclude Fields

2019-03-22 17:35发布

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 fields 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?

标签: c# AutoMapper
1条回答
Deceive 欺骗
2楼-- · 2019-03-22 18:22
.ForMember(dto => dto.field1, opt => opt.Ignore());
查看更多
登录 后发表回答