Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CreateMap<SourceType, DestinationType>()
- // here goes some actual mapping code:
- .ForMember(dest => dest.DestMember, opt => opt.MapFrom(src => src.SourceMember))
- // and then go the explicitly ignored unmapped dest members,
- // just for AssertConfigurationIsValid to pass:
- .ForMember(dest => dest.IgnoredMember, opt => opt.Ignore());
- [TestMethod]
- public void TestMappingConfiguration()
- {
- Mapper.AddProfile<MyProfile>();
- Mapper.FindTypeMapFor<SourceType, DestinationType>()
- .ForMember(dest => dest.IgnoredMember, opt => opt.Ignore());
- Mapper.AssertConfigurationIsValid(MyProfile.Name);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement