AutoMapper/AutoMapper — Issue #163: CreateMapExpression attempts to bind ignored property maps.
Author: Sleepyhead
Created: 2011-12-22 15:15:47+00:00
State: open

It appears that when using .Project().To() will attempt to create expressions for ignored properties, resulting in the following exception:
Argument types do not match
System.ArgumentException
at System.Linq.Expressions.Expression.Bind(MemberInfo member, Expression expression) at AutoMapper.MappingEngine.CreateMapExpression(Type typeIn, Type typeOut) at AutoMapper.MappingEngine.CreateMapExpression(Type typeIn, Type typeOut) at AutoMapper.MappingEngine.CreateMapExpression(Type typeIn, Type typeOut) at AutoMapper.MappingEngine.b__7[TSource,TDestination](TypePair tp) at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) at AutoMapper.MappingEngine.CreateMapExpression[TSource,TDestination]() at AutoMapper.QueryableExtensions.ProjectionExpression`1.To[TResult]()