AutoMapper using the wrong constructor

You just need to add explicit cast to

Func<ResolutionContext, TypeOne>

Here is the code:

Mapper.CreateMap<TypeOneDto, TypeOne>().ConstructUsing(
            (Func<ResolutionContext, TypeOne>) (r => new TypeOne()));

Current version of AutoMapper works as described below:

  1. Sorts destination type constructors by parameter count

    destTypeInfo.GetConstructors().OrderByDescending(ci => ci.GetParameters().Length);
    
  2. Takes first constructor which parameters match source properties (without any check for null value). In your case it is constructor with two parameters.


Here's an extension method...

    public static void CreateMapWithDefaultConstructor<T, TU>(this Profile profile)
        where TU : class, new()
    {
        profile.CreateMap<T, TU>().ConstructUsing(source => new TU());
    }