When I use AutoMapper to map an object from a namespace to another namespace (with same datatypes) it seems to map to the wrong namespace.
Simple sample:
namespace AutoMapperSamples.Namespace10
{
public class Outer
{
public int Value { get; set; }
public object Inner { get; set; }
}
}
namespace AutoMapperSamples.Namespace20
{
public class Outer
{
public int Value { get; set; }
public object Inner { get; set; }
}
}
Mapping this like:
var dest = config.CreateMapper().Map<Namespace10.Outer, Namespace20.Outer>(source);
Results in Outer class mapped correctly to Namespace20.Outer but the Inner object is of type Namespace10.Inner (instead of if Namespace20).
Since this my classes are generated from a webservice (svcUtil) (where the field is a choice type (which can be one of two classes) thus created as an object type.
Is there a convenient way around this?