0

I'm finding a way to drive AutoMapper through user-defined configuration without changing codes.

For example, I want user-defined mapping definition like Source.Property.SubProperty1 => Result.SubProperty drives how AutoMapper maps during run time.

Appreciate any suggestion.

DLeh
  • 23,806
  • 16
  • 84
  • 128
  • I'm not sure I understand the question. Do you want to have several AutoMapper configurations, and then at runtimee decide programatically which configuration to use? – Andersnk Jan 06 '15 at 19:55
  • 1
    sorry friend but can't understand, could you clarify your goal please – niceman Jan 06 '15 at 20:00
  • @AndersNK Thanks for your time and checking my question. Sorry that my question wasn't clear. I updated it and hope it becomes better. Yes, I am finding a way to have several AutoMapper configurations which will decide how it maps at run time. – Pyit Phyo Aung Jan 06 '15 at 21:09
  • @niceman Thanks for your time and checking my question. Hope you understand me through updated question and my reply to AndersNK. I tried to reply to you both but I can only notify one user at a time here. – Pyit Phyo Aung Jan 06 '15 at 21:11
  • @PyitPhyoAung I see "I'm finding" could you put your effort in the question, and glad to help :) – niceman Jan 06 '15 at 21:16
  • This question (and answer) might be of interest http://stackoverflow.com/questions/2183401/using-profiles-in-automapper-to-map-the-same-types-with-different-logic – Andersnk Jan 06 '15 at 21:50
  • Thanks very much the link @AndersNK. So far, I've tried to define, compile and generate dynamic mapping class for simple mapping definitions at runtime and to use that assembly to define AutoMapper mapping and it looks promising so far. I'm exploring for more complex mapping categories like custom mapping. – Pyit Phyo Aung Jan 07 '15 at 20:15

0 Answers0