I am mapping with automapper 10.1.1 in c# 9 from this class
public record BFrom
{
public Guid Id { get; init; }
public Guid DbExtraId { get; init; }
}
into this
public record ATo(Guid Id, Guid ExtraId) : BaseTo(Id);
And have the following configuration
CreateMap<BFrom, ATo>()
.ForMember("ExtraId", opt => opt.MapFrom(src => src.DbExtraId))
.ReverseMap();
But I have a problem when I am trying to map it throws an exception with a message that needs to have a constructor with 0 args or only optional args. Is it possible to fix this problem without changing the record types?