0

I'm trying to ignore a property from my type when performing mapping using AutoMapper. I define 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.

Daniel Schilling
  • 4,829
  • 28
  • 60
Davita
  • 8,928
  • 14
  • 67
  • 119
  • can you post the code to you `Map` function call? I just threw together an equivalent example and it worked. What is the Id getting initialized to? – Pero P. Mar 30 '11 at 21:44
  • This functionality has been working for me as well. Please post a failing example so we can try it. – rboarman Mar 30 '11 at 21:53
  • Also, how are you executing the map -- is Automapper creating the destination or are you providing an existing destination? – PatrickSteele Mar 31 '11 at 00:21

1 Answers1

-3

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

Davita
  • 8,928
  • 14
  • 67
  • 119