I have two classes
public class SourceClass
{
public Guid Id { get; set; }
public string Provider { get; set; }
}
public class DestinationClass
{
public Guid Id { get; set; }
public List<string> Provider { get; set; }
}
My mapping is as follows:
CreateMap<SourceClass, DestinationClass>()
.ForMember(destinationMember => destinationMember.Provider,
memberOptions => memberOptions.MapFrom(src =>
new List<string> { src.Provider ?? "" }));
Now, previously Provider in the DestinationClass was Providers and the mapping worked as normal. However, after making the spelling in both classes consistent, the mapping fails to happen properly.
"Test" from Source class maps to ["T", "e", "s", "t"]. When the property names were different in each class, the mapping worked correctly.
ProviderstoProvider?