I\'m trying to use AutoMapper to flatten multiple levels of arrays.
Consider the following source classes:
class X {
public string A { get; set;
For anyone else coming across this post by searching how to Flatten object structure with AutoMapper - the new AutoMapper supports flattening with IncludeMembers() syntax.
Source: http://docs.automapper.org/en/stable/Flattening.html
So the original issue could be solved like this:
Mapper.CreateMap();
Mapper.CreateMap().IncludeMembers(src => src.D);
Mapper.CreateMap().IncludeMembers(src => src.B);