AutoMapper/AutoMapper — Issue #173: AssertConfigurationIsValid() getting confused by get-only properties
Author: danthman
Created: 2012-02-24 22:47:21+00:00
State: open

I am trying to map from an entity to a WPF view model.

I have three getters that look like this:

public DoubleCollection ExtenderStrokeDashArray
{
get { return new DoubleCollection { 1.5 / Thickness, 3 / Thickness }; }
}

When I try `Mapper.AssertConfigurationIsValid()`, I get an error stating:

> The following 3 properties on Viewer.ViewModels.SymbolViewModel are not mapped:
ExtenderStrokeDashArray
LeaderStrokeDashArray
EdgeStrokeDashArray
Add a custom mapping expression, ignore, or rename the property on Viewer.Entities.Contact.

I have a number of other get-only properties that return something other than a `DoubleCollection`, and they are correctly ignored by the configuration validator, so I suspect something about `DoubleCollection` is gumming up the works.

Ignoring these three properties in my configuration seems to solve the problem with no side effects, but it seems strange to have to explicitly ignore properties that have no setter.