I am working with AutoMapper and some of the values for the entity being mapped to are variables in my current method. I have tried to Google it but to no avail. Can I pass
AutoMapper handles this key-value pair scenario out of the box.
Mapper.CreateMap() .ForMember(d => d.Foo, opt => opt.ResolveUsing(res => res.Context.Options.Items["Foo"]));
Then at runtime:
Mapper.Map(src, opt => opt.Items["Foo"] = "Bar");
A bit verbose to dig into the context items but there you go.