AutoMapper/AutoMapper — Issue #151: Parent object access in .ConstructUsing()
Author: igitur
Created: 2011-11-25 12:43:14+00:00
State: open

Hi,

Please refer to https://groups.google.com/forum/#!topic/automapper-users/0tUKY11bZHw for the full discussion.

I'd like to to access an object's parent in the .ConstructUsing method.

Jimmy said:
```
> Actually, this isn't too bad of a fix. Right now I do something like this:
```
if (typeMap != null && typeMap.DestinationCtor != null)
return typeMap.DestinationCtor(context.SourceValue);
```
> But that "context" variable has all of the contextual information, including the parent object. I could modify that overload to > take the ResolutionContext object instead. Look for a drop in the next day or so (or feel free to submit a pull request yourself ;)