Search code examples
automapperautomapper-5

Issue while Automapper Upgrade to 5.1.1


We were using the automapper v5.0 in our code. In our create map statement, we had a statement ->

m.ResolveUsing((src, o, context) => (CodeObject)context.Options.Items["test"]))

When we upgraded the Automapper version to 5.1.1, we are getting build error in the above statement.

Can you please suggest how to correct this with latest version.


Solution

  • Finally i have got the answer after going through the automapper source code. We can do it this way:

    m => m.ResolveUsing((src, o, destMemb, context) => (CodeObject)context.Items["test"]))