replaysMike/AnyMapper

Unable to map read-only properties

Closed this issue · 2 comments

Unable to map read-only property, for example Age from the sample below:

public class Person
{
    public string Name { get; set; }
    public DateTime DOB { get; set; }
    public int Age => DateTime.Now.Subtract(DOB).Days / 365;
}

public class Customer
{
    public string Name { get; set; }
    public DateTime DOB { get; set; }
    public int Age { get; set; }
}

var person = new Person() { Name = "Furqan Safdar", DOB = new DateTime(1985, 11, 14) };
var target = AnyMapper.Mapper.Map<Person, Customer>(person);

Thanks! I should be able to fix this without a problem

This is now fixed as of 1.0.18