2

Is it posible to inject a value from a method using ValueInjecter ?

Similar to what AutoMapper do (GetTotal()) : https://github.com/AutoMapper/AutoMapper/wiki/Flattening

Thanks

Paul
  • 12,359
  • 20
  • 64
  • 101

1 Answers1

1

it can be done, but you would have to create your own injection that will be able to do that: for example you could grab the code for SmartConvetionInjection

http://valueinjecter.codeplex.com/wikipage?title=SmartConventionInjection

and add the feature of matching property names to methods that Start with Get+ThatName

atm only the properties are scanned, note the line

    var sourceProps = source.GetProps();
    var targetProps = target.GetProps();
Omu
  • 69,856
  • 92
  • 277
  • 407