MapTo
MapTo copied to clipboard
Special cases
It would be awesome if there is a chance to customize mapping method body with some lambda expression.
In example
// Source
public class OrderLine
{
public int Amount { get; set; }
public float UnitPrice { get; set; }
}
// Target
[MapFrom(typeof(OrderLine))]
public class OrderLineViewModel
{
[MapProperty(Rule = "Amount * UnitPrice")] // 👈 Something like this
public float TotalPrice { get; set; }
}
And some class to define customizations: