I have the following class:
public class Response{
public string Result {get;set;}
public ArrayList Errors {get;set;}
}
and the following mappings
cfg.CreateMap<ErrorMessage, Error>();
cfg.CreateMap<OriginalResponse, Response>()
.ForMember(d => d.Errors,
opts => opts.MapFrom(s => s.ErrorMessages));
In my source, ErrorMessages is an Array of type ErrorMessage.
I would like like the Errors ArrayList in my response to be of type Error but my mapping is returning an ArrayList of type ErrorMessage (the original type).
How could I get the ArrayList to map correctly?
I can't use a regular array of type Errors because of the limitations of a 3rd party system.
Repro here: https://dotnetfiddle.net/VPRsYV
ArrayListin .net these days?ErrorMessage) and not the destination type (Error)