Hello Everyone, so I happen to came across a very strange bug, I was trying to map between two records and the mapping won't work even with explicit configuration between the two records. After some debugging I discovered that the mapping fails if the parameters names start with 2 capital letters.
For simplicity here is a snippet if how you can produce this bug
var firstObject = new FirstObject("xxASqwqs");
var secondObject = FirstObject.Adapt<SecondObject>();
public record FirstObject(string QRUrl);
public record SecondObject(string QRUrl);
The secondObject QRUrl variable will contain a null string after mapping, and if you try to to explicitly add a config like this
var config = new TypeAdapterConfig();
config.NewConfig<FirstObject, SecondObject>()
.Map(dest => dest.QRUrl, src => src.QRUrl);
var firstObject = new FirstObject("xxASqwqs");
var secondObject = firstObject.Adapt<SecondObject>(config);
It will also fail and the QRUrl will be populated as null, The only thing that worked for me after debugging is to the change the QRUrl paramater to QrUrl and then the mapping worked.
Hello Everyone, so I happen to came across a very strange bug, I was trying to map between two records and the mapping won't work even with explicit configuration between the two records. After some debugging I discovered that the mapping fails if the parameters names start with 2 capital letters.
For simplicity here is a snippet if how you can produce this bug
The secondObject QRUrl variable will contain a null string after mapping, and if you try to to explicitly add a config like this
It will also fail and the QRUrl will be populated as null, The only thing that worked for me after debugging is to the change the QRUrl paramater to QrUrl and then the mapping worked.
Is this behavior normal ?