Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. CreateMap<SourceType, DestinationType>()
  2. // here goes some actual mapping code:
  3. .ForMember(dest => dest.DestMember, opt => opt.MapFrom(src => src.SourceMember))
  4. // and then go the explicitly ignored unmapped dest members,
  5. // just for AssertConfigurationIsValid to pass:
  6. .ForMember(dest => dest.IgnoredMember, opt => opt.Ignore());
  7.  
  8. [TestMethod]
  9. public void TestMappingConfiguration()
  10. {
  11. Mapper.AddProfile<MyProfile>();
  12. Mapper.FindTypeMapFor<SourceType, DestinationType>()
  13. .ForMember(dest => dest.IgnoredMember, opt => opt.Ignore());
  14. Mapper.AssertConfigurationIsValid(MyProfile.Name);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement