Automapper already does some nice convention stuff like mapping sub-properties by naming convention e.g. OrderTotal
would map from Order.Total
if such a property on a property existed.
I was wondering if there is a way to do a similar thing with LINQ operator names. For example if I had a collection IEnumerable<Appointment>
called Appointments
, it would be great if on my target type I had a property called AppointmentFirst
of type Appointment and AutoMapper automagically called First()
.
Is there any way to do something like this currently?
There is no support for such things out of the box. However you can achieve it by using custom type converters.