Automapper and private members?

This is in regards to Automapper on CodePlex (the dto mapping tool).

Can it handle mapping using private members like NHibernate can? The documentation is very slim, but it seems like one of the objects or methods provided with the tool could do something like this.

Mapper
.With<FooDTO>()
.Map(x => x.Value)
.To<Foo>(“_value”);

// To<T>(string member) or To<T>(Func<T, bool> func)

Mapper.CreateMap<Foo, FooDTO>();

I know my example methods don’t exist as-is, but maybe I’ve overlooked something else already built in. Any ideas?

I figured this one out, and it was way simpler than I expected. Attached is a very small solution, with sample classes and tests, that show you how to map a dto to an entity with private fields.

:slight_smile: