[MapDestination(typeof(PendingOrder))]
public class Order
{
public string Id {get; set;}
public DateTime PlacementDate {get; set;}
public bool IsGift {get; set;}
}
public class PendingOrder
{
public string Id {get; set;}
public string Status {get; set;}
public bool IsGift {get; set;}
public DateTime PlacementDate {get; set;}
}
public void PerformTheMapping()
{
var order = _orderRepo.Get("A124B2");
var pendingOrder = SimpleMapper.Mapper.Copy<Order, PendingOrder>(order);
}
[MapDestination(typeof(WildCat))]
public class Cat
{
public string Breed {get; set;}
public double Weight {get; set;}
}
[RequireAllProperties]
public class WildCat
{
public string Breed {get; set;}
public string Weight {get; set;}
public string Region {get; set;}
}
When performing a call to Map
on WildCat
a MissingMemberException
will be thrown.
[MapDestination(typeof(MultiDestinationOne), typeof(MultiDestinationTwo))]
private class MultiDestinedSource
{
public string Name { get; set; } = "Scratchy";
}
private class MultiDestinationOne
{
public string Name { get; set; }
}
private class MultiDestinationTwo
{
public string Name { get; set; }
}