MapTo icon indicating copy to clipboard operation
MapTo copied to clipboard

Special cases

Open enisn opened this issue 3 years ago • 0 comments

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:

enisn avatar Aug 03 '22 13:08 enisn