You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The query fails with an AutoMapperMappingException.
Unable to create a map expression from Foo.A (Foo) to FooDto.A (System.Int32)
Mapping types:
Foo -> FooDto
Foo -> FooDto
Type Map configuration:
Foo -> FooDto
Foo -> FooDto
Property:
A
Foo.A (an int) is called a Foo by the exception.
The PropertyMap correctly identifies the SourceType as System.Int32. Mapper.Map<FooDto>(new Foo()) also works as expected.
It does not matter if I use the static configuration method or create an instance of mapper and pass it to ProjectTo().
When I use this simple test program:
The query fails with an AutoMapperMappingException.
Foo.A (an
int
) is called aFoo
by the exception.The
PropertyMap
correctly identifies the SourceType asSystem.Int32
.Mapper.Map<FooDto>(new Foo())
also works as expected.It does not matter if I use the static configuration method or create an instance of mapper and pass it to ProjectTo().
If I adjust the configuration like this:
The error goes away.
The text was updated successfully, but these errors were encountered: