Unable to map read-only properties
Closed this issue · 2 comments
furqansafdar commented
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);
replaysMike commented
Thanks! I should be able to fix this without a problem
replaysMike commented
This is now fixed as of 1.0.18