开发者

AutoMapper's Ignore() not working?

开发者 https://www.devze.com 2023-02-20 17:00 出处:网络
I\'m trying to ignore a property from my type when performing mapping using AutoMapper. I def开发者_Go百科ine mapping this way:

I'm trying to ignore a property from my type when performing mapping using AutoMapper. I def开发者_Go百科ine mapping this way:

Mapper.CreateMap<TypeA, TypeA>().ForMember(dest => dest.Id, opt => opt.Ignore());

Both source and destination are the same types. When I call Map function, destination's Id property gets updated anyway. I'm using the latest version downloaded from CodePlex.


Sorry guys, it was my stupid fault. That's why one should not work at 4 am :(

0

精彩评论

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