-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Source/destination types
public class Foo
{
public Foo(int baz, int bar)
{
Baz = baz;
Bar = bar;
}
public int Baz { get; }
public int Bar { get; }
}Mapping configuration
var configuration = new MapperConfiguration(cfg => { });
var mapper = configuration.CreateMapper();Version: x.y.z
12.0.0
Expected behavior
an instance of Foo is created with Baz set to 3 and Bar set to 6.
Actual behavior
Exception thorwn
Test.Foo needs to have a constructor with 0 args or only optional args. Validate your configuration for details.
Steps to reproduce
var configuration = new MapperConfiguration(cfg => { });
var mapper = configuration.CreateMapper();
var dict = new Dictionary<string, object>
{
{"baz",3},
{"bar",6},
};
var result = mapper.Map<Foo>(dict);Metadata
Metadata
Assignees
Labels
No labels