I have a lots of mapping profiles, how can I find the correct mapping configuration from specific map operation in source code? Can Resharper or a Visual Studio extension help?
I would like to jump from this:
var userDto = this.mapper.Map<User, UserDto>(user);
to this:
MapperConfiguration config = new MapperConfiguration(cfg =>
{
cfg.CreateMap<User, UserDto>(MemberList.None);
/*etc...*/
});
It is possible? How could I realize it?
What about isolating your mapping in its own class.
Your Profiles registration may differ, but here is how they could be dynamically registered.
That way, you can search for that profile class by its name, and easily navigate to your mapping.
It will work if you know that User mappings are in the
UserProfile
class.