A zero-configuration, highly-configurable, unopinionated object mapper with viewable execution plans. Flattens, unflattens, deep clones, merges, updates and projects queries. .NET 3.5+ and .NET Standard 1.0+.
Sorry, I cannot find any documentation about this apparently easy task.
The situation is this:
public interface IFoo
{
string Name { get; set; }
}
public class FooDto : IFoo
{
public string Name { get; set; }
}
public class Foo
{
public string Name { get; set; }
}
I'm tring to configure the following mappings:
public class FooMappingConfiguration : MapperConfiguration
{
protected override void Configure()
{
GetPlansFor<Foo>().To<FooDto>(); // works
GetPlansFor<IFoo>().To<Foo>(); // works
WhenMapping
.From<Foo>().To<IFoo>()
.MapTo<FooDto>()
;
GetPlansFor<Foo>().To<IFoo>(); // doesn't work!!!
}
}
When I test the mapping plans it gives me the following error:
Sorry, I cannot find any documentation about this apparently easy task. The situation is this:
I'm tring to configure the following mappings:
When I test the mapping plans it gives me the following error:
I also tried with CreateInstancesOf but the error remains the same. What am I doing wrong? Any suggestion?